From: zhaohs <[EMAIL PROTECTED]>

> > > Now I write a shell script to generate the subfonts of *Unicode*
> > > encoded real fonts and subfonts which are mapped to virtual GBK
> > > fonts, [...]
> > >
> > > I find that in the pdf or ps file, the english are ritht, but the
> > > chinese are messy codes, why?  The attachemt is my shell script
> > 
> > Sorry, I don't have time to check your script in detail, but: Don't
> > install the *.enc files!  They must not be used.
> > 
> > You might have a look into the Makefile Danai has posted a few weeks
> > ago to this list -- it does something similar for Korean fonts.
> 
>    I see the  Makefile Danai has posted to the mail list, but perhaps it
> is too complicated  to use by me, so I want to use the subfonts.pe the 
> generate
> another *set* of subfonts with GBK encoding.

Attached you will see a file called "rules": this is the file
debian/rules that is used in one of my Debian packages (still under
scrutiny by the Debian FTP masters).

You can use this file as an example, just to give you an idea.


Cheers




Danai SAE-HAN
韓達耐

-- 
題目:《秋日》
作者:程顥(1032-1085)

閑來無事不從容,睡覺東窗日已紅。
萬物靜觀皆自得,四時佳興與人同。
道通天地有形外,思入風云變態中。
富貴不淫貧賤樂,男兒到此是豪雄。
#!/usr/bin/make -f
# -*- makefile -*-

# debian/rules file
# GNU GPL v2, Copyright (C) 2005-2006, Danai SAE-HAN <[EMAIL PROTECTED]>

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Arphic PL fonts information

fonts = bsmi bkai gbsn gkai

bsmi_typeface = bsmi00lp
bsmi_namestem = bsmi
bsmi_sfdnamestem = bsmilp
bsmi_uninamestem = bsmiu
bsmi_familyname = AR PL Mingti2L Big5
bsmi_encoding = UBig5

bkai_typeface = bkai00mp
bkai_namestem = bkai
bkai_sfdnamestem = bkaimp
bkai_uninamestem = bkaiu
bkai_familyname = AR PL KaitiM Big5
bkai_encoding = UBig5

gbsn_typeface = gbsn00lp
gbsn_namestem = gbsn
gbsn_sfdnamestem = gbsnlp
gbsn_uninamestem = gbsnu
gbsn_familyname = AR PL SungtiL GB
gbsn_encoding = UGB

gkai_typeface = gkai00mp
gkai_namestem = gkai
gkai_sfdnamestem = gkaimp
gkai_uninamestem = gkaiu
gkai_familyname = AR PL KaitiM GB
gkai_encoding = UGB

cjk_fontencoding = 0
UBig5_planes = 55
UBig5_inputencoding = 0
UBig5_texinput = usr/share/texmf/tex/latex/CJK/Bg5/
UBig5_codingscheme = cjkbig5
UGB_planes = 35
UGB_inputencoding = 1
UGB_texinput = usr/share/texmf/tex/latex/CJK/GB/
UGB_codingscheme = cjkgb

fonttype = truetype
supplier = arphic

typeface = $($(abbrev)_typeface)
familyname = $($(abbrev)_familyname)
encoding = $($(abbrev)_encoding)
namestem = $($(abbrev)_namestem)
sfdnamestem = $($(abbrev)_sfdnamestem)
uninamestem = $($(abbrev)_uninamestem)
planes = $($(encoding)_planes)
nfss_fontencoding = $($(encoding)_inputencoding)$(cjk_fontencoding)
codingscheme = $($(encoding)_codingscheme)
bin-package = latex-cjk-chinese-$(supplier)-$(typeface)
binary_fonts = $(addprefix binary_,$(fonts))
build-stamp_fonts = $(addprefix build-stamp.,$(fonts))
install_fonts = $(addprefix install_,$(fonts))
clean_fonts = $(addprefix clean_,$(fonts))

# Path names

d = debian/$(bin-package)
texmf = usr/share/texmf
fontpath = usr/share/fonts/$(fonttype)/$(supplier)
dest_texfontpath = $(texmf)/fonts/$(fonttype)/$(supplier)
dest_afmpath = $(texmf)/fonts/afm/$(supplier)/$(uninamestem)
dest_type1path = $(texmf)/fonts/type1/$(supplier)/$(uninamestem)
dest_uni-tfmpath = $(texmf)/fonts/tfm/$(supplier)/$(uninamestem)
dest_sfd-tfmpath = $(texmf)/fonts/tfm/$(supplier)/$(sfdnamestem)
dest_vfpath = $(texmf)/fonts/vf/$(supplier)/$(namestem)
dest_docpath = usr/share/doc/texmf/fonts/$(fonttype)/$(supplier)
dest_fd = $($(encoding)_texinput)
builddir = build/$(typeface)
sfddir = /$(texmf)/fonts/sfd

ERR = cat log; echo "Errare humanum! Please have a look at $(builddir)/log."; 
exit 1


build: build-stamp

build-stamp: $(build-stamp_fonts)
        dh_testdir

# Add here commands to compile the package.

        touch build-stamp

$(build-stamp_fonts): abbrev = $(patsubst build-stamp.%,%,$@)
$(build-stamp_fonts):
        dh_testdir
        mkdir -p $(builddir)
        ( cd $(builddir); ln -s /$(fontpath)/$(typeface).ttf; cp 
../../debian/latex-cjk/* . )

        # You will find a detailed log of the build process in $(builddir)/log.

        # Create Unicode encoded subfonts `$(uninamestem)00' .. 
`$(uninamestem)ff'.
        # This will take more than an hour.  Make yourself a cup of tea.
        @echo fontforge -script subfonts.pe $(typeface).ttf $(uninamestem) 
$(sfddir)/Unicode.sfd
        @( cd $(builddir); fontforge -script subfonts.pe $(typeface).ttf 
$(uninamestem) $(sfddir)/Unicode.sfd > log 2>&1 || ($(ERR)) )
        @echo

        # Create font `$(uninamestem)v' with all vertical glyph representation 
forms.
        @echo fontforge -script vertical.pe $(typeface).ttf $(uninamestem)v
        @( cd $(builddir); fontforge -script vertical.pe $(typeface).ttf 
$(uninamestem)v >> log 2>&1 || ($(ERR)) )
        @echo

        # Create font `$(uninamestem)vr' which has the same structure as 
`$(uninamestem)v',
        # but normal glyphs instead of vertical representation forms.
        @echo fontforge -script vertref.pe $(typeface).ttf $(uninamestem)vr
        @( cd $(builddir); fontforge -script vertref.pe $(typeface).ttf 
$(uninamestem)vr >> log 2>&1 || ($(ERR)) )
        @echo

        # Create a virtual font `$(sfdnamestem)v' which is a clone of 
`$(uninamestem)v'.
        @echo perl clonevf.pl $(uninamestem)v $(sfdnamestem)v
        @( cd $(builddir); perl clonevf.pl $(uninamestem)v $(sfdnamestem)v >> 
log 2>&1 || ($(ERR)) )
        @echo

        # Create virtual fonts `$(sfdnamestem)00' .. `$(sfdnamestem)$(planes)' 
in $(encoding) encoding
        # which use Unicode encoded `$(uninamestem)XX' subfonts as raw fonts
        # and `$(codingscheme)' as the `CODINGSCHEME' parameter value.
        @echo perl uni2sfd.pl $(uninamestem) $(sfddir)/$(encoding).sfd 
$(sfdnamestem) $(codingscheme)
        @( cd $(builddir); perl uni2sfd.pl $(uninamestem) 
$(sfddir)/$(encoding).sfd $(sfdnamestem) $(codingscheme) >> log 2>&1 || 
($(ERR)) )
        @echo

        # Create entries for the extended font definition file
        # `c$(nfss_fontencoding)$(namestem).fdx' (which uses $(encoding) 
encoding), with `$(uninamestem)vr' as
        # the reference font.
        @echo perl makefdx.pl $(uninamestem)vr.afm $(sfddir)/$(encoding).sfd 
c$(nfss_fontencoding)$(namestem).fdx
        @( cd $(builddir); perl makefdx.pl $(uninamestem)vr.afm 
$(sfddir)/$(encoding).sfd c$(nfss_fontencoding)$(namestem).fdx >> log 2>&1 || 
($(ERR)) )
        @echo

        # Create entries for the extended font definition file
        # `c$(nfss_fontencoding)$(namestem).fdx' (which uses Unicode encoding), 
with `$(uninamestem)vr' as
        # the reference font.
        @echo perl makefdx.pl $(uninamestem)vr.afm $(sfddir)/Unicode.sfd 
c70$(namestem).fdx
        @( cd $(builddir); perl makefdx.pl $(uninamestem)vr.afm 
$(sfddir)/Unicode.sfd c70$(namestem).fdx >> log 2>&1 || ($(ERR)) )
        @echo

        # Remove the *.enc files; they're not used.
        @( cd $(builddir); rm -f *.enc )
        @echo

        # Create a Type1 font map.
        @( cd $(builddir); for filename in *.pfb; do if [ $$filename != 
"$(uninamestem)vr.pfb" ] ; then echo "$$(basename $$filename .pfb) $$(basename 
$$filename .pfb) <$$filename" >> $(uninamestem).map; fi; done )
        @echo

        # Create entries for the font definition file
        # `c$(nfss_fontencoding)$(namestem).fd' (which uses $(encoding) 
encoding).
        @cd debian; \
            sed -e 's/@NFSS_FONTENCODING@/$(nfss_fontencoding)/g' \
                -e 's/@NAMESTEM@/$(namestem)/g' \
                -e 's/@ENCODING@/$(encoding)/g' \
                -e 's/@FONTENCODING@/$(encoding)/g' \
                -e 's/@FAMILYNAME@/$(familyname)/g' \
                -e 's/@SUBNAMESTEM@/$(sfdnamestem)/g' \
                font.fd.in > ../$(builddir)/c$(nfss_fontencoding)$(namestem).fd
        @echo

        # Create entries for the font definition file
        # `c70$(namestem).fd' (which uses Unicode encoding).
        @cd debian; \
            sed -e 's/@NFSS_FONTENCODING@/70/g' \
                -e 's/@NAMESTEM@/$(namestem)/g' \
                -e 's/@ENCODING@/$(encoding)/g' \
                -e 's/@FONTENCODING@/Unicode/g' \
                -e 's/@FAMILYNAME@/$(familyname)/g' \
                -e 's/@SUBNAMESTEM@/$(uninamestem)/g' \
                font.fd.in > ../$(builddir)/c70$(namestem).fd
        @echo

        touch $@

clean: pre-clean $(clean_fonts)
        dh_testdir
        dh_testroot
        rm -f build-stamp

        dh_clean 
        rm -rf build/

pre-clean:
        cd debian; cp control.stem.in control

$(clean_fonts): abbrev = $(patsubst clean_%,%,$@)
$(clean_fonts): DH_OPTIONS = -p$(bin-package) -P$(d)
$(clean_fonts):
        @cd debian; \
            sed -e 's/@TYPEFACE@/$(typeface)/g' \
                -e 's/@FAMILYNAME@/$(familyname)/g' \
                control.leaf.in >> control
        @cd debian; \
            sed -e 's/@ABBREV@/$(abbrev)/g' \
                -e 's/@FAMILYNAME@/$(familyname)/g' \
                -e 's/@TYPEFACE@/$(typeface)/g' \
                copyright.in > $(bin-package).copyright
        dh_clean $(DH_OPTIONS)
        rm -f build-stamp.$(abbrev)


install: build $(install_fonts)
$(install_fonts): abbrev = $(patsubst install_%,%,$@)
$(install_fonts): DH_OPTIONS = -p$(bin-package) -P$(d)
$(install_fonts):
        dh_testdir
        dh_testroot
        dh_clean -k 
        dh_installdirs

binary-indep: build install $(binary_fonts)
$(binary_fonts): abbrev = $(patsubst binary_%,%,$@)
$(binary_fonts): DH_OPTIONS = -p$(bin-package) -P$(d)
$(binary_fonts):
        dh_testdir $(DH_OPTIONS)
        dh_testroot $(DH_OPTIONS)
        dh_installchangelogs $(DH_OPTIONS)
        dh_installdocs $(DH_OPTIONS)
        dh_installexamples $(DH_OPTIONS)
        dh_install $(DH_OPTIONS) $(builddir)/*.afm $(dest_afmpath)/
        dh_install $(DH_OPTIONS) $(builddir)/$(uninamestem)*.tfm 
$(dest_uni-tfmpath)/
        dh_install $(DH_OPTIONS) $(builddir)/$(sfdnamestem)*.tfm 
$(dest_sfd-tfmpath)/
        dh_install $(DH_OPTIONS) $(builddir)/*.pfb $(dest_type1path)/
        dh_install $(DH_OPTIONS) $(builddir)/*.vf $(dest_vfpath)/
        dh_install $(DH_OPTIONS) $(builddir)/$(uninamestem).map 
/usr/share/texmf/fonts/map/dvips/arphic/
        dh_install $(DH_OPTIONS) 
$(builddir)/c$(nfss_fontencoding)$(namestem).fd{,x} $(dest_fd)/
        dh_install $(DH_OPTIONS) $(builddir)/c70$(namestem).fd{,x} 
usr/share/texmf/tex/latex/CJK/UTF8/
        dh_link $(DH_OPTIONS)
#       dh_installtexfonts $(DH_OPTIONS) Map=$(uninamestem).map
        dh_installtex $(DH_OPTIONS) --flavor=map:config_for_all_maps 
map=Map,$(uninamestem).map
        dh_strip $(DH_OPTIONS)
        dh_compress $(DH_OPTIONS)
        dh_fixperms $(DH_OPTIONS)
        dh_perl $(DH_OPTIONS)
        dh_installdeb $(DH_OPTIONS)
        dh_gencontrol $(DH_OPTIONS)
        dh_md5sums $(DH_OPTIONS)
        dh_builddeb $(DH_OPTIONS)


# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install \
        $(fonts) $(install_fonts) $(binary_fonts) $(clean_fonts) pre-clean
_______________________________________________
Cjk maillist  -  [email protected]
http://lists.ffii.org/mailman/listinfo/cjk

Reply via email to