HBF2GF(1) HBF2GF(1) NAME hbf2gf−convertaCJKbitmapfontintosubfontsusablebyTeXandOmega. SYNOPSIS hbf2gf[-q]configuration-file[.cfg] hbf2gf [-q][-p][-g][-n]subfont-namex-resolution[y-scale|y-resolution] hbf2gf-t[-q]subfont-name hbf2gf--version|--help DESCRIPTION CJKbitmapfontscan’tbedirectlyusedwithTEXbecausethenumberofcharactersinsuchfonts exceeds256,thelimitofaTEXfont.Thusitisnecessarytosplitthesefontsintosubfonts,and thisisexactlywhathbf2gfdoes. Asthenamesays,hbf2gfusesCJKfontsinacertainformatwhichiscalledHanziBitmap Font(HBF)format.ItsimplyconsistsoftheCJKbitmapfile(s)andatextfileinaformatvery similartotheBDFformatoftheXWindowSystemwhichdescribesthebitmapfontfiles:theencoding,thesize,etc.TheproducedGFfilescanthenbeconvertedwithgftopkintostandardPK files. hbf2gfcanbecalledinthreemodes: hbf2gf[-q]configuration-file[.cfg] ThiscallnormallycreatesasetofGFfiles,onePLfile,andabatchfilewhichmustbe executedafterhbf2gfhasfinished.ThisscriptwillthencallgftopktoconvertallGF filesintoPKfiles,anditwillcallpltotftoconvertthePLfileintoaTFMfile.Finallyit willcopytheTFMfilesothateachPKfilehasitsTFMfile(whichareallidentical). Ifofmfileissetto‘yes’intheconfigurationfile,OFMandOVFfileswillbecreatedtoo. -qmakeshbf2gfquiet. hbf2gf [-q][-p][-g][-n]subfont-namex-resolution[y-scale|y-resolution] Thismodeisintendedforusewithmktexpkanditsderivates.OnlyoneGFfiletogetherwithaPLfileforthegivensubfontwillbecomputed,takingthehorizontalresolutionandaverticalscalingfactor(ifthevalueissmallerthan10)resp.thevertical resolution(otherwise)fromthecommandline,ignoringthenmbfontsparameterof theconfigurationfile.Thelasttwocharacters(whichareinterpretedasthesubfont number)arestrippedtogetthenamefortheconfigurationfile(whichmustendwith ‘.cfg’).Nojobfilewillbecreated.Ifoption-pisset,noPLfileiscreated.If-gis set,noGFfileiscreated.Theextensioncanbecontrolledwith-n;ifset,theextension is‘.gf’,otherwise‘.<resolution>gf’.-qmakeshbf2gfquiet. hbf2gf -t[-q]subfont-name Thismodeisintendedforusewithscriptslikemktexpk;ittestswhetherthespecified subfontnameleadstoanhbf2gfconfigurationfile.Itreturns0onsuccessandprints outthenameofthatconfigurationfile(providedthe-qswitchisn’tset).Thistest isn’tathoroughone;itonlyremovesthelasttwocharactersandcheckswhetheraconfigurationfilewiththatnameexists. Seethenextsectionformoredetailsaboutconfigurationfiles. Specifyingtheoption--versionreturnsthecurrentversionofhbf2gfandtheusedfilesearchli-brary(e.g.kpathsea).Usageinformationisshownwiththe--helpparameter. CONFIGURATIONFILE Hereasampleconfigurationfile(gsfs14.cfg)fora56x56ChinesefontinGBencoding;notethat allinformationaboutthefontisinthejfs56.hbffile.SeetheFILESEARCHINGsection howHBFfontsandhbf2gfconfigurationfilesarefound.SeetheAVAILABILITYsection wheretogetCJKfontstogetherwithitsHBFfiles: CJKVersion4.2.0 13-Dec-1998 1 HBF2GF(1) HBF2GF(1)

hbf_headerjfs56.hbf
mag_x1
threshold128
commentjiantifansongti56x56pixelfont
design_size14.4
y_offset-13
nmb_files-1
output_namegsfs14
checksum123456789
dpi_x300
pk_filesno
tfm_filesyes
codingcodingschemeGuoBiaoencodedTeXtext
pk_directory$HBF_TARGET/pk/modeless/gb2312/gsfs14/
tfm_directory$HBF_TARGET/tfm/gb2312/gsfs14/

Aconfigurationfileisaplaintextfileconsistingofkeywordsanditsarguments.Akeywordmust startaline,otherwisethewholelinewillbeignored.Ifthewordstartingalineisnotakeyword, thelinewillbeignoredtoo.Emptylineswillalsobeskipped.Thesearchforkeywordsiscaseinsensitive;incontrast,theargumentswillbetakenexactlyasgiven(except‘yes’and‘no’which canbewrittenwithuppercaseorlowercaseletters).Eachkeywordhasoneargumentwhichmust beseparatedbywhitespace(blanksortabs)fromthekeywordandmustbeonthesameline. Eachlinemustnotbelongerthan256characters. Youcanuseenvironmentvariablesintheconfigurationfile.Theescapecharacterstartinganenvironmentvariableintheconfigurationfileisalways‘$’,evenforoperatingsystemslikeDOS whichhasotherconventions.hbf2gfrecognizesonlyenvironmentvariablenameswhichstart withaletteroranunderscore,followedbyalphanumericcharactersorunderscores.Youcansurroundthevariablewithbracestoindicatewherethevariablenameends,forexample${FOO}.To getadollarsignyoumustwrite‘$$’.Theexpansionofenvironmentvariablesinhbf2gfitself (withoutthehelpofeitherkpathseaortheemtexdirsearchingroutines)isverylimited;thisfeaturehasbeencarriedoverfrompreviousversions.Itcan’texpandvariablessetintexmf.cnf;italsocan’thandlemorethanonedirectoryasthevariable’svalue.Don’tuseitexceptforthe ‘pkdirectory’and‘tfmdirectory’parameters! Thisisthelistofallnecessarykeywords: hbfheader theHBFheaderfilenameoftheinputfont(s).hbf2gfusesthegivensearchingmechanism(kpathseaoremtexdir)tolocatethisfile. outputname thenamestemoftheoutputfiles.Arunningtwodigitdecimalnumberstartingwith‘01’ willbeappended.ForUnicodefontsseethekeywordunicodebelow.Thisvalueisinalmostallcasesidenticaltothenameoftheconfigurationfile. Andnowalloptionalkeywords: CJKVersion4.2.0 13-Dec-1998 2 HBF2GF(1) HBF2GF(1) xoffset increasesthecharacterwidth.Willbeappliedonbothsides;defaultfornon-rotated glyphsisthevaluegivenintheHBFheader(HBFBITMAPBOUNDINGBOX) scaledtodesignsize(inpixels). yoffset shiftsallcharactersupordown;defaultfornon-rotatedglyphsisthevaluegiveninthe HBFheader(HBFBITMAPBOUNDINGBOX)scaledtodesignsize(inpixels). designsize thedesignsize(inpoints)ofthefont.xoffsetandyoffsetrefertothissize.Default is10.0 slanttheslantofthefont(givenasΔx/Δy).Onlyvaluesintherange0≤slant≤1areallowed.Defaultis0.0 rotation ifsetto‘yes’,allglyphswillberotated90degreescounter-clockwise.Thedefaultoffsets asgivenintheHBFheaderwillbeignored(andsetto0).Defaultis‘no’. magx magy scalingvaluesofthecharacterstoreachdesignsize.Ifonlyonemagnificationisgiven,x andyvaluesareassumedtobeequal.Defaultismagx=magy=1.0 threshold Avaluebetween1and254definingathresholdforconvertingtheinternalgraymapinto theoutputbitmap;lowervaluescutmorepixels.Defaultvalueis128. comment acommentdescribingthefont;defaultisnone. nmbfonts thenumberofsubfontstocreate.Defaultvalueis-1forcreatingallfonts. unicode if‘yes’,atwodigithexadecimalnumberwillbeusedasarunningnumber,startingwith thevalueofthefirstbyteofthefirstcoderange.Defaultis‘no’. dpix dpiythehorizontalandverticalresolution(indpi)oftheprinter.Ifonlyoneresolutionisgiven,xandyvaluesareassumedtobeequal.Defaultis300. checksum achecksumtoidentifytheGFfileswiththeappropriateTFMfiles.Thedefaultvalueof thisunsigned32bitintegeris0. coding acommentdescribingthecodingscheme;defaultisnone. pkdirectory thedestinationdirectoryofthePKfiles;default:none.Attention!Thebatchfilewillnot checkwhetherthisdirectoryexists. tfmdirectory thedestinationdirectoryoftheTFMfiles;default:none.Attention!Thebatchfilewillnot checkwhetherthisdirectoryexists. CJKVersion4.2.0 13-Dec-1998 3 HBF2GF(1) HBF2GF(1) pkfiles whethertocreatePKfilesornot;defaultis‘yes’. tfmfiles whethertocreateTFMfilesornot;defaultis‘yes’. ofmfile whethertocreateanOPLfileornot;defaultis‘no’.Thebatchfilewillthenuseovp2ovf oftheOmegadistributiontoconvertitintoanOFMandanOVFfile.TheOPLfilesimply mapsallsubfontsbacktoasingleOmegafont. longextension if‘yes’,PKfileswillincludetheresolutionintheextension(e.g.gsso1201.300pk).This affectsthebatchfileonly(defaultis‘yes’). rmcommand theshellcommandtoremovefiles;default:‘rm’. cpcommand theshellcommandtocopyfiles;default:‘cp’. jobextension theextensionofthebatchfilewhichcallsgftopkandpltotftoconverttheGFandthePL filesintoPKandTFMfilesrespectively;defaultisnone. FILESEARCHING hbf2gfuseseitherthekpathseaoremtexdirlibraryforsearchingfiles(thelatterwillworkonly onoperatingsystemswhichhaveanMS-DOSishbackground,i.e.,MS-DOS,OS/2,Windows). KPATHSEA Pleasenotethatolderversionsofkpathsea(<3.2)havenospecialmeanstoseachforprogram relatedfiles,thusweusethepathsforPostScriptrelatedstuff.Theactualversionofkpathseais displayedonscreenifyoucallhbf2gf--versioncommandlineswitch. Hereisatableofthefiletypeandthecorrespondingkpathseavariables.HBF2GFINPUTSisa programspecificenvironmentvariablesintroducedinkpathseaversion3.2:

.hbfT1FONTS
.cfgHBF2GFINPUTS

Andherethesameforpre-3.2-versionsofkpathsea:

.hbfT1FONTS
.cfgTEXCONFIG

Finally,thesameforversions≤2.6:

.hbfDVIPSHEADERS
.cfgTEXCONFIG

Pleaseconsulttheinfofilesofkpathseafordetailsonthesevariables.Thedecisionwhichnamingschemetouseforvariableswillbedoneduringcompilation. YoushouldsettheTEXMFCNFvariabletothedirectorywhereyourtexmf.cnfconfigurationfileresides. EMTEXDIR Herethelistofsuffixesanditsrelatedenvironmentvariablestobesetinautoexec.bat(resp.in

config.sysforOS/2):
.hbfHBFONTS
.cfgHBFCFG

Ifoneofthevariablesisn’tset,awarningmessageisemitted.Thecurrentdirectorywillalways besearched.Asusual,oneexclamationmarkappendedtoadirectorypathcausessubdirectories CJKVersion4.2.0 13-Dec-1998 4 HBF2GF(1) HBF2GF(1) oneleveldeeptobesearched,twoexclamationmarkscausesallsubdirectoriestobesearched. Example:

HBFONTS=c:\fonts\hbf!!;d:\myfonts\hbf!

Constructionslike‘c:\fonts!!\hbf’aren’tpossible. LIMITATIONS ThexandyoutputsizemustnotexceedMAXCHARSIZE,whichisdefinedatcompiletime; itsdefaultvalueis255(pixel). SEEALSO ttf2pk(1)

hbf2gf.w:

thisisthesourcecodewritteninCWEBwhichcanbeconvertedintoapretty-printed TEXdocumentusingcweave.TheCJKpackagealsocontainsapreformatted

hbf2gf.dvifile.

theCJKdocumentationfiles(hbf2gf.doc). theHanziBitmapFile(HBF)standardversion1.3;availableatftp.ifcss.org theOmegadocumentationavailableatftp.ens.frandtheCTANhostsandmirrors. FILES *.cfgThehbf2gfconfigurationscripts *.hbfHBFheaderfileswhichdescribefixed-widthbitmapfonts.Notethatthebitmapfont name(s)themselvesasspecifiedintheheaderfilesareirrelevantforhbf2gf. AVAILABILITY hbf2gfispartoftheCJKmacropackageforLATEX2εavailableattheCTANhostsanditsmirrors. CJKfontstogetherwithHBFheaderfilescanbefoundatftp.ifcss.organditsmirrors. AUTHORS WernerLemberg<wl@gnu.org> RossPaterson(theHBFAPI)<ross@soi.city.ac.uk> CJKVersion4.2.0 13-Dec-1998 5