[XeTeX] Re: MathTime fonts
Jonathan Kew
jonathan_kew at sil.org
Sun Sep 5 00:29:34 CEST 2004
On 4 Sep 2004, at 10:02 pm, Paul Edney wrote:
> Perhaps I should remove the fink one anyway. I initially installed it
> for some other GNU package, but perhaps I can symlink the fink one to
> Gerben's. But I'd rather change only one thing at a time for now.
>
>
>> How did you generate .otf files from the .pfb ones? Creating .otf
>> files that will work right with XeTeX can be a bit of a hassle, and I
>> haven't gotten everything documented nicely yet. (Sorry!)
>>
>> Did you do this for the CM fonts (if so, why? the XeTeX installer
>> should have provided them), or only for the MathTime ones?
>>
>
> I converted the mac font using CMacTeX's 'lwfn2pfb' script. This
> conversion seems to work fine, as these fonts do render in LaTeX, but
> are 'not found' in XeTeX. To convert them to otf, I opened the .pfb
> files (mtex.pfb, mtsy.pfb, and rmtmi.pfb) in fontforge and generated
> the Open Type (CFF) with an .otf extension. I also tried Open Type
> (Mac Font) and removed the '.dfont' part of the '.otf.dfont'
> extension. With the Mac Font version, XeTeX reports 'not found' and
> the display is completely blank (no +,-, and parentheses here).
When you say they're "not found in XeTeX", I assume you're getting a
message such as
*** font mtex (MTEX: file 'mtex') not found
printed on the console? This is coming from xdv2pdf rather than from
xetex itself, as that's the process that needs access to the actual
glyphs; the xetex formatting process depends only on the TFMs.
> I didn't touch the CM fonts at all. Only the 3 mathtime fonts I
> mentionned above.
OK. Do plain CM examples (such as "CM-test.tex" from the XeTeX Sample
Files archive) work?
>> > Then I ran
>> > xetex -no-pdf testfile.tex
>> [snip]
>> > Output written on testfile.xdv (1 page, 2144 bytes).
>> > Transcript written on testfile.log.
>> >
>> > No font errors here,
>>
>> Looks fine; so it found the right .tfm files, just like regular
>> LaTeX....
>
> Pardon my ignorance, but I didn't generate or move any .tfm files. In
> fact, when I didn't have the .otf (CFF) fonts, XeTeX reported 'font
> not found'. And when I replaced the otf (CFF) with the otf (Mac
> Font), I got the 'not found' message again. Does XeTeX only search
> for the .tfm if it succeeds in finding a 'decent' otf? Somehow I
> thought tfm's were used before otf's (as in tex before dvipdf).
The Mathtime .tfms are preinstalled as part of teTeX/gwTeX, so they're
available to xetex (just as they are to other TeX engines).
The "not found" messages you're referring to, as noted above, are from
xdv2pdf, I believe. (If in doubt, you can verify this by running the
two processes separately.)
I suspect that Apple Type Services can't use the "Mac Font" versions
where you removed .dfont from the name because such a file is not in
fact a plain .otf font; it's an OpenType font packaged in a
resource-file structure (within the data fork of the file). Changing
the file extension misleads the system, and so then it doesn't succeed
in activating the font.
>> Could you check your psfonts.map file and tell me what the actual
>> entries for these fonts look like? I don't have the Mathtime fonts and
>> so I'm not in a position to try and duplicate your exact setup.
>
> kpsewhich psfonts.map
> /usr/local/teTeX/share/texmf.local/fonts/map/dvips/updmap/psfonts.map
>
> then grep on psfonts.map for 'mtex', 'mtsy', and 'rmtmi':
> MTEX MTEX <mtex.pfb
> mtex MTEX <mtex.pfb
> MTSY MTSY <mtsy.pfb
> mtsy MTSY <mtsy.pfb
> RMTMI RMTMI <rmtmi.pfb
> rmtmi RMTMI <rmtmi.pfb
>
> there is no explicit encoding, as in, for example:
> cmtex10 CMTEX10 " TeXd9b29452Encoding ReEncodeFont " <d9b29452.enc
> <cmtex10.pfb
With no explicit encoding, it's kind of a lottery as to whether you'll
get the right glyphs; XeTeX (or rather xdv2pdf), generating PDF through
CoreGraphics, has to take the character codes from your document and
draw glyphs that it identifies by glyph ID within the font. But without
a .enc file, it doesn't have knowledge of the encoding vector that was
supposed to be used. For many of the fonts I converted to .otf, I was
able to arrange the conversion so that there's a simple character/glyph
correspondence, but this may not always work out so well.
So I'm guessing that one reason only a few characters show up is that
the .otf fonts don't have the glyphs in the order xdv2pdf is expecting
(or guessing). An .enc file would probably help....except that there's
probably no 'name' table in these .otf fonts either, and so xdv2pdf
would be unable to apply it.
If I learned enough about FontForge, maybe I could come up with a
.pfb->.otf script that handles these issues..... or if I thoroughly
documented what xdv2pdf is doing, maybe someone else would deal with
it. It's all just a question of time.....
> I'm guessing (very wildly) from Bruno's message below that this
> reencoding step might have an effect. Btw, Bruno, I used to use
> mathtime on textures through ATM, so the fonts were never in the
> system folder. But why would TeX search the classic folder for fonts
> in the first place? Did I misunderstand you? Should I _also_ copy
> the original mathtime fonts to the system folder, or at least activate
> them with fontbook?
>
> Also, could Bruno's note about the hybrid mathtime explain why +, -,
> \ldots, and parentheses (of all sizes) render, but nothing else?
Maybe; I don't fully understand what that's about. I wonder if it's
simply a character/glyph mapping problem, though.
>
>
>> > What really puzzles me is that in TeXshop, LaTeX handles mathtime
>> like
>> > a charm, whereas XeTeX doesn't. Don't they read from the same
>> > texmf.local tree?
>>
>> They do, and they're both handling things fine at the typesetting
>> stage, I think (using the .TFM files); but when it comes to actually
>> rendering glyphs, they're relying on quite different versions of the
>> fonts.
>
> so technically it would be incorrect to think
> XeTeX = ( LaTeX + additional_font_engines ), right?
XeTeX = TeX (e-TeX, actually) + Unicode + additional font support + PDF
output (via xdv2pdf)
But xdv2pdf does *not* support all the same font formats (in
particular, .vf and .pfb, and bitmap fonts) as standard DVI drivers or
pdfTeX.
So roughly speaking, XeLaTeX = LaTeX + Unicode + Apple fonts -
.vf/.pfb/.pk fonts.
Jonathan
More information about the XeTeX
mailing list