[XeTeX] fontspec v1.7
Bruno Voisin
bvoisin at mac.com
Mon Jun 20 01:43:14 CEST 2005
Le 19 juin 05 à 17:10, Will Robertson a écrit :
> Maths is something that I've never got quite right in fontspec
> since things like mathrm, accents, and various incidental
> characters like uppercase greek (!), round brackets, and so on, are
> all taken from various disparate fonts. I simply haven't taken the
> time to see what is the ideal case when you're typesetting a maths
> text with Hoefler & Euler, or Lucida, or whatever.
>
> It's top of my list, but my fontspec list isn't on the top of my
> meta-list, unfortunately. I'll see what I can do. If you would like
> to look into it yourself, the fontspec code that deals with maths
> is right at the very end of the .dtx file (it's all
> \AtBeginDocument to override euler.sty's effects). Bruno has posted
> lots of interesting bits and pieces to this mailing list, so by
> removing what you find in fontspec and playing around with the
> different components you could easily catch up to my knowledge of
> LaTeX maths fonts (which is, sadly, not much).
I've obtained the same kind of crashes in XeTeX (no PDF generated,
and xdv2pdf being the culprit) when trying to use accents from an OS
X font in maths, either with fontspec.sty or when calling the font
directly.
Accordingly, the culprits in fontspec.sty appear to be the lines:
> \DeclareSymbolFont{operators}\zf at enc\rmdefault\mddefault\updefault
> \SetSymbolFont{operators}{normal}\zf at enc\rmdefault\mddefault
> \updefault
> \SetMathAlphabet\mathrm{normal}\zf at enc\rmdefault\mddefault\updefault
> \SetMathAlphabet\mathit{normal}\zf at enc\rmdefault\mddefault\itdefault
> \SetMathAlphabet\mathbf{normal}\zf at enc\rmdefault\bfdefault\updefault
> \SetMathAlphabet\mathsf{normal}\zf at enc\sfdefault\mddefault\updefault
> \SetMathAlphabet\mathtt{normal}\zf at enc\ttdefault\mddefault\updefault
> \SetSymbolFont{operators}{bold}\zf at enc\rmdefault\bfdefault\updefault
> \SetMathAlphabet\mathrm{bold}\zf at enc\rmdefault\bfdefault\updefault
> \SetMathAlphabet\mathit{bold}\zf at enc\rmdefault\bfdefault\itdefault
> \SetMathAlphabet\mathsf{bold}\zf at enc\sfdefault\bfdefault\updefault}
They work fine as long as math accents aren't used, but yield the
above bug as soon as math accents are used. And indeed, if in Herb's
example the following line is commented out:
> How about a math accent: \(\dot x = \ddot x\).
then everything works well.
I see only two possible explanations:
- Either the accents are situated at positions that XeTeX can't
access in an ATSUI font. Here that would correspond to (from
fontmath.ltx):
> \DeclareMathAccent{\dot}{\mathalpha}{operators}{"5F}
> \DeclareMathAccent{\ddot}{\mathalpha}{operators}{"7F}
Just to be sure, I've used nfssfont.tex to draw font maps for cmr10
(LaTeX's default for math accents, in OT1 encoding) and Optima
Regular. They seem to indicate it's no good thinking of taking math
accents from an OS X font anyway, as many of them simply aren't there.
- Or the definition of \DeclareMathAccent (in latex.ltx) is
incompatible with ATSUI fonts in XeTeX. But that seems unlikely,
given this definition is very similar to \DeclareMathSymbol, which
doesn't cause any problem.
Unfortunately I haven't had time to look at this more closely. In any
case it seems to be linked with encodings.
Possibly a solution would be to define a new symbol font (similar to
"operators") just for taking the math accents from it, and use cmr10
for example (or lbr).
Bruno
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nfssfont-cmr10.pdf
Type: application/pdf
Size: 45753 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20050620/6d3ad97c/nfssfont-cmr10-0001.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nfssfont-optima.pdf
Type: application/pdf
Size: 85175 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20050620/6d3ad97c/nfssfont-optima-0001.pdf
More information about the XeTeX
mailing list