[XeTeX] Re: [MacTeX] XeTeX 0.4 available (Modified by Jonathan Kew)
Jonathan Kew
jonathan_kew at sil.org
Wed Apr 21 15:11:17 CEST 2004
sorry, reposting to the now-working XeTeX list, where this more
properly belongs -- JK
On 20 Apr 2004, at 10:40 pm, Bruno Voisin wrote:
> (As I've been bounced back by the XeTeX list, I'm going back to
> MacTeX.)
>
(I haven't had success with the XeTeX list yet either.)
>> I've posted a new version of XeTeX, the Unicode-based TeX for OS X;
>> see
>>
>> http://scripts.sil.org/xetex/
>>
>> This fixes a number of reported bugs:
>> * incorrect setting of \mathchar values
>> * height and width keywords for \picfile and \pdffile were not working
>> * fclose() error messages related to font loading
>> * excessively large PDF file generation when using TFM-based (rather
>> than AAT) fonts
>> * bad OTF encoding prevented Acrobat viewing output with TFM-based
>> fonts
>
> In addition to these, it seems that the bug in the implementation of
> \magnification in xvd2pdf has also been fixed. Thanks again.
You're right; sorry, forgot to put that in the notes.
There are also a couple of new command-line options in xdv2pdf, for
those who are delving into details. I've updated the "update" note on
the web page.
> I just tried XeTeX on another situation: Lucida fonts. In both plain
> TeX
> and LaTeX, things don't work (as soon as the font calls are changed to
> CM,
> things become OK).
>
> I thought of several possible explanations, being unsure about any:
>
> - On my setup, the fonts are available in FFIL and LWFN formats in
> /System
> Folder/Fonts/, and in PFB format in
> /usr/local/teTeX/share/texmf.local/fonts/type1/yandy/, but not in OTF
> format. Is it that XeTeX can only work with OTF fonts ? (I think not.)
The installed FFIL/LWFN fonts are, at least in principle, usable by
XeTeX. The PFBs are not.
>
> - With plain TeX, the fonts are called by their original Y&Y names, for
> example (taken from lcdplain.tex):
>
> \font\tenrm=lbr at 9.5pt \font\sevenrm=lbr at 6.9pt
> \font\fiverm=lbr
> at 5.2pt
>
> whereas the LWFN font files have different names such as LucidBri. If I
> understood correctly, XeTeX searches first for font files, either in
> /System Folder/Fonts/ or /Library/Fonts/ or ~/Library/Fonts/, with the
> same names as the metrics, so it might be fooled here by the different
> names.
It doesn't search for font *files* in the system directories; it
searches for *installed fonts* through ATSUI APIs (searching on the
PostScript names of the fonts). So if the name of the TFM file, as used
in the \font command, and the PostScript name of the installed font
differ, we lose.
If it doesn't find an *installed font* with the name needed, it looks
for an OTF file by that name, activates it, and then tries again to
find the installed font. (So the internal PostScript name of the OTF
font had better match its filename, or else it will still fail.)
> Is there some equivalent scheme in XeTeX to Textures' metrics
> suitcases, or OzTeX's config files, to map TeX metrics names to Mac
> screen
> and printer font files?
Not yet but some day there should be.
> Or it is simpler to just modify the font calls to
> the Mac OS font names, for example:
>
> \font\tenrm="Lucida Bright" at 9.5pt
> \font\sevenrm="Lucida Bright" at 6.9pt
> \font\fiverm="Lucida Bright" at 5.2pt
This should work, but note that you will almost certainly not get
identical layout, as XeTeX will now find your installed Textures fonts
and do all measurement through ATSUI, not using TFMs at all. This
should be fine for running text, but may not give you identical
line-breaks to those you get in a standard TeX setup. (You won't be
getting the ligatures and kerning from the .tfm file, for example; if
any are defined in the AAT fonts you'd get those, but I'm pretty
confident there won't be.)
> - With LaTeX, the fonts are called by a different scheme: in TeX 'n
> ANSI
> (LY1) encoding, for example, the LaTeX input file looks for the metrics
> hlhr8y.tfm matched by the dvips map file to the font lbr.pfb inside
> /usr/local/teTeX/share/texmf.local/fonts/type1/yandy/lubright/. Does
> XeTeX
> use such mapping information, and can it use PFB files inside the teTeX
> directories? (I think not.)
It cannot use .pfb files from the /teTeX tree (or anywhere else)
directly. It can render any font that's *installed* in the Mac OS X
font folders, so that it's visible to ATSUI (available in TextEdit, for
example); in addition, it can use .otf fonts (only) from the /teTeX
tree; xdv2pdf actually renders these by temporarily "activating" them
using Mac OS APIs, before drawing the required glyphs through Quartz.
It also does not (yet) support any kind of "font mapping" to associate
TFM font names with Mac OS fonts. That's something still to be done;
not sure whether I can have it use the dvips map directly or if
something different will be necessary. There are some issues of
encoding to worry about too.
>
> It is of course possible to edit the various input files to replace TeX
> "devious" font names by the corresponding Mac font names, and I don't
> really mind, but I'm just wondering if there is something obvious I'm
> doing wrong.
No; you're just discovering the disconnect between the world of TFM
files, as used by TeX in typesetting, and Mac OS X fonts, as used by
xdv2pdf in rendering!
Hope this helps clarify what's happening, and what the restrictions are
at the moment. Support for TFM-based typesetting was not a priority in
developing this tool (after all, there's already pdfTeX etc for that!);
the focus was on working directly with AAT fonts. So this whole area of
TFM-based font support is very underdeveloped at the moment; but expect
to see things improve in the future. For now, the CM (etc) fonts that I
bundled with XeTeX in OTF format should work, but beyond that, it's
uncharted territory.
(Note for the ambitious: if you have the tools to convert your PFBs to
OTFs, as I've done for the CM fonts, and make sure the names match your
TFMs, you ought to be able to get them to work.)
Jonathan
More information about the XeTeX
mailing list