font management simplified (was Re: [OS X TeX] Trump Mediaeval fonts_

Bruno Voisin bvoisin at mac.com
Sun Oct 3 08:08:57 CEST 2004


Le 3 oct. 04, à 04:08, Scott Murman a écrit :

>  right now we have a few old font descriptions that "just work" with 
> all tex flavors, and few can go beyond that.   jonathon - and everyone 
> else out there working on this stuff - please make it "just work" for 
> advanced fonts as well.   i'm sure to you guys this stuff is like 
> walking, but it makes my head spin.  i'm sure there are underlying 
> technical reasons why it's difficult, but these can be overcome.

Not so sure they can. LaTeX font management is intrinsically difficult, 
requiring a bunch of information, stored usually in a set of .sty, .fd, 
.tfm, .vf and .map files, for each single font to become available.

"Old font descriptions just work" (I suppose by old font you mean Times 
Helvetica etc.) because somebody (Sebastian Rahtz, and now Walter 
Schmidt) took the time to write these styles, definition files, metrics 
etc. for all the 35 fonts shipped with the LaserWriter printers of that 
time; that's the so-called PSNFSS package. For example the font 
declaration in my previous message:

\DeclareFontFamily{U}{osxppl}{}
\DeclareFontShape{U}{osxppl}{m}{n}
   {<-> "Palatino"}{}
\DeclareFontShape{U}{osxppl}{m}{it}
   {<-> "Palatino\space Italic"}{}
\DeclareFontShape{U}{osxppl}{b}{n}
   {<-> "Palatino\space Bold"}{}
\DeclareFontShape{U}{osxppl}{b}{it}
   {<-> "Palatino\space Bold\space Italic"}{}
\DeclareFontShape{U}{osxppl}{bx}{n}
   {<-> ssub * osxppl/b/n}{}
\DeclareFontShape{U}{osxppl}{bx}{it}
   {<-> ssub * osxppl/b/it}{}
\DeclareFontShape{U}{osxppl}{m}{sl}
   {<-> ssub * osxppl/m/it}{}
\DeclareFontShape{U}{osxppl}{b}{sl}
   {<-> ssub * osxppl/b/it}{}
\DeclareFontShape{U}{osxppl}{bx}{sl}
   {<-> ssub * osxppl/bx/it}{}

is just a quick XeLaTeX equivalent to the PSNFSS one in 
/usr/local/teTeX/share/texmf.tetex/tex/latex/psnfss/t1ppl.fd, namely:

\DeclareFontFamily{T1}{ppl}{}
\DeclareFontShape{T1}{ppl}{m}{n}
   {<-> pplr8t}{}
\DeclareFontShape{T1}{ppl}{m}{sc}
   {<-> pplrc8t}{}
\DeclareFontShape{T1}{ppl}{m}{sl}
   {<-> pplro8t}{}
\DeclareFontShape{T1}{ppl}{m}{it}
   {<-> pplri8t}{}
\DeclareFontShape{T1}{ppl}{b}{n}
   {<-> pplb8t}{}
\DeclareFontShape{T1}{ppl}{b}{sc}
   {<-> pplbc8t}{}
\DeclareFontShape{T1}{ppl}{b}{sl}
   {<-> pplbo8t}{}
\DeclareFontShape{T1}{ppl}{b}{it}
   {<-> pplbi8t}{}
\DeclareFontShape{T1}{ppl}{bx}{n}{<->ssub * ppl/b/n}{}
\DeclareFontShape{T1}{ppl}{bx}{sc}{<->ssub * ppl/b/sc}{}
\DeclareFontShape{T1}{ppl}{bx}{sl}{<->ssub * ppl/b/sl}{}
\DeclareFontShape{T1}{ppl}{bx}{it}{<->ssub * ppl/b/it}{}

XeLaTeX actually makes it simpler, because it doesn't require you (the 
user) to create, in addition to the above font declarations, .tfm, .vf 
and .map files for the font. For example, for Palatino the "old font 
setup just works" because of the presence, in teTeX, not only of 
t1ppl.fd, but also of all the files inside:

/usr/local/teTeX/share/texmf.tetex/fonts/tfm/adobe/palatino/
/usr/local/teTeX/share/texmf.tetex/fonts/vf/adobe/palatino/
/usr/local/teTeX/share/texmf.tetex/dvips/tetex/dvips35.map

So what you're asking, in essence, is somebody (or a group of people) 
to write manually .fd font definition files, to be shipped with XeTeX, 
for all the hundreds of fonts available on the Mac platform. Sorry, I 
don't think that will happen. Besides, once you've understood the basic 
rules concerning these files, and the way font naming works on Mac OS 
X, they're really not that difficult to write; only tedious.

Back to the "old font setup", after the PSNFSS package was first 
written, a tool has been developed by Alan Jeffreys, called "fontinst", 
for automatically building LaTeX support files (i.e. .sty, .fd, .tfm, 
.vf and .map files) for any PostScript font, based on the .afm files 
normally shipped with this font and on a few minimal interactions with 
the user; see 
/usr/local/teTeX/share/texmf.tetex/doc/fontinst/base/fontinst.dvi. 
Similarly, a tool afm2tfm, only building .tfm and .vf files, is shipped 
with dvips; see 
/usr/local/teTeX/share/texmf.tetex/doc/programs/dvips.pdf. Both were to 
the expense of an often cryptic naming scheme for the fonts. I don't 
think that either has ever been used widely for fonts outside the basic 
35 LaserWriter ones, except maybe by some font specialists.

So what would answer your request would be a similar tool, built for 
XeTeX and creating automatically a .fd font definition file for any 
specified OS X font. I'm not sure that's technically feasible. For one 
thing, there's the often inconsistent font naming on OS X: some fonts 
have "Regular" in their name for the basic (i.e. not bold, not italic) 
shape, others don't; some have "Text" in their names, or "MS", others 
don't; etc. Thus it's difficult to automate things fully.

Plus, that tool would need to detect automatically the different AAT or 
OpenType features available for each font, and enable their activation 
at will during creation of the .fd file. In the XeTeX Samples folder, 
XeTeX includes files AAT-info.tex and OpenType-info.tex which, once 
processed in plain TeX, give the list of these features for any given 
font. But manual creation of a .fd file by the user remains necessary. 
Again, I don't think it's that difficult; only tedious.

Bruno Voisin
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list