Using OpenType and TrueType fonts in LaTeX ========================================== Martin Rubli, 2006-01-18 References: http://www.tug.org/tex-archive/info/TrueType/ ftp://ftp.dante.de/tex-archive/info/fontname/html/ http://www.se.eecs.uni-kassel.de/~thm/OpenOffice.org/bugs.html http://www.tug.org/texlive/devsrc/Master/texmf-dist/doc/fontinst/base/talks/et99-font-tutorial.pdf http://ipe.compgeom.org/pdftex_1.html Convert OpenType fonts to TrueType fonts ---------------------------------------- otf2ttf script: #!/usr/bin/fontforge # otf2ttf: Quick and dirty hack: converts a font to truetype (.ttf), works only with one font. Print("Opening "+$1); Open($1); Print("Saving "+$1:r+".ttf"); Generate($1:r+".ttf"); Quit(0); Use the following command to convert multiple fonts: for font in *.otf; do otf2ttf $font; done Determine the Berry font name ----------------------------- ftp://ftp.dante.de/tex-archive/info/fontname/html/ We use the 'Meridien LT Std' font as an example: In our case, ftp://ftp.dante.de/tex-archive/info/fontname/html/Adobe-fonts.html contains the following lines: pmdb8a Meridien-Bold A 112 m0b_____ pmdbi8a Meridien-BoldItalic A 112 m0bi____ pmdri8a Meridien-Italic A 112 m0i_____ pmdr8a Meridien-Roman A 112 m0r_____ So the supplier/family identifier is 'pmd'. Convert TrueType fonts for use in LaTeX --------------------------------------- 1. Rename the TrueType font files according to the Berry font name scheme 2. Generating the Postscript Type1 fonts: ttf2pt1 -a -e pmdb8a.ttf pmdb8a ttf2pt1 -a -b pmdb8a.ttf pmdb8a ttf2pt1 -a -e pmdbi8a.ttf pmdbi8a ttf2pt1 -a -b pmdbi8a.ttf pmdbi8a ttf2pt1 -a -e pmdr8a.ttf pmdr8a ttf2pt1 -a -b pmdr8a.ttf pmdr8a ttf2pt1 -a -e pmdri8a.ttf pmdri8a ttf2pt1 -a -b pmdri8a.ttf pmdri8a Remember the font names output by the ttf2pt1 tool: FontName MeridienLTStd-Bold FontName MeridienLTStd-BoldItalic FontName MeridienLTStd-Roman FontName MeridienLTStd-Italic 3. Generating the TEX related font files tex fontinst.sty * \latinfamily{pmd}{} \bye for f in *.pl; do pltotf $f; done for f in *.vpl; do vptovf $f; done rm *.pl *.vpl *.mtx 4. Move the files to the right places export TMF=`kpsexpand '$TEXMFLOCAL'` for f in tfm vf pfa afm ttf; do mkdirhier $TMF/fonts/$f/adobe/meridien mv -v *.$f $TMF/fonts/$f/adobe/meridien done mkdirhier $TMF/fonts/type1/adobe/meridien mv -v *.pfb $TMF/fonts/type1/adobe/meridien mkdirhier $TMF/tex/latex/psnfss mv -v *.fd $TMF/tex/latex/psnfss 5. Make dvips find the new fonts config.meridien: o p +meridien.map meridien.map: pmdb8r MeridienLTStd-Bold "TeXBase1Encoding ReEncodeFont" <8r.enc