[XeTeX] fontspec v1.7

Ross Moore ross at ics.mq.edu.au
Thu Jun 23 03:06:01 CEST 2005

Hi Will, and Jonathan,

     Time to return to this problem with math-accents !

On 20/06/2005, at 11:32 PM, Will Robertson wrote:

> On 20 Jun 2005, at 4:42 PM, Ross Moore wrote:
>>>> \documentclass{article}
>>>> \DeclareFontFamily{U}{osx}{}
>>>> \DeclareFontShape{U}{osx}{m}{n}{<-> "Hoefler\space Text"}{}
>>>> \DeclareSymbolFont{break}{U}{osx}{m}{n}
>>>> \DeclareMathAccent{\dot}{\mathalpha}{break}{"5F}
>>>> \begin{document}
>>>> $\dot x$
>>>> \end{document}
>> After upgrading to  XeTeX  0.94  I get the same output.
>> However, it took an awfully long time for the PDF to appear.
> I'm not seeing the same thing.

My mistake. It must have been an older .pdf that was being shown...

> The above document fails with xdv2pdf ("bus error") consistently on  
> my machine.

  ... since I get this too, with  xdv2pdf, version 0.94.

But there is no "bus error" when using version 0.87.

> I have no idea where the difference might be.
> I'm stumped if what you say is correct. (And I don't disbelieve you!)

It wasn't correct, as I wasn't correctly controlling my experimentation,
so drew some wrong conclusions.

Here is some more detailed information.

Firstly, my test file source  (mdtest.tex) :

\DeclareFontShape{U}{osx}{m}{n}{<-> "Hoefler\space Text"}{}

\dot x
\ddot x








Note that the "correct" Unicode accent characters to use
are the latter ones:  "0307  and  "0308 .

However, the TeX syntax for  \mathaccent  doesn't accommodate
hex-strings longer than 2 characters.
So that's one change that Jonathan needs to make for XeTeX.

Alternatively, we have to avoid using the  \mathaccent
primitive altogether, and do accents differently.
This could be done for LaTeX by rewriting  \DeclareMathAccent
--- but this is no good for  Plain XeTeX  users.

Next best thing is to try using  "27  and  "A8
for the accent characters, with Hoefler.
This is because of encoding differences in the TeX math fonts.

Also, use the command-line:
     xelatex -no-pdf  mdtest.tex
     xdv2pdf  mdtest.xdv

xelatex works fine. It is xdv2pdf which fails.

Now the .log output from XeTeX contains:

>> {the letter x}
>> {blank space  }
>> \dot ->\mathaccent "745F\relax
>> {\mathaccent}
>> {blank space  }
>> \ddot ->\mathaccent "74A8\relax
>> {\mathaccent}
>> {blank space  }
>> {math shift character $}
>> Missing character: There is no ¨ in font Hoefler Text!
>> [1] (./mdtest.aux) )
>> (see the transcript file for additional information)
>> Output written on mdtest.xdv (1 page, 544 bytes).
>> Transcript written on mdtest.log.

That  "Missing character"  line is interesting,
since  Hoefler *does* contain a character at  "48
  --- as can be seen by the result of   test\char"A8
in a PDF made from commenting-out *both* the lines
containing :  \dot x  and  \ddot x .

When you do this, the "Combining Accent" characters
  "0307  and  "0308  are positioned **after** the
final 't' in 'test', at least with  Hoefler Text  as font.
Changing font to  Lucida Grande  the accents are positioned
correctly over that final 't'.

If you comment-out the line  \ddot x  in the source,
then the above warning goes away, but  xdv2pdf  still fails.

If you instead comment-out the line  \dot x  then  xdv2pdf   now works!
But it gives warnings:

>> WARNING: Type1 font data returned by OFAStreamPSDownload isn't in  
>> the correct format required by the Adobe Type 1 Font Format  
>> specification.
>> WARNING: Type1 font data returned by OFAStreamPSDownload isn't in  
>> the correct format required by the Adobe Type 1 Font Format  
>> specification.

It is interesting that XeTeX reports a problem with  \char"A8
when used as a math-accent, but fails to put it into the .xdv file.
Yet it reports no problem with \char"27 .

There is one aspect of these tests which isn't ideal yet.
That is, the font used for the 'x' in math is still  cmmi10 .
So I don't see how  XeTeX  can position the accent automatically.
Ideally we want:  <italic x><dot accent>  to do the right thing.

Surely this means that both the 'x' and "0307" must come from
the same font; e.g.  HoeflerText-Italic .

Either that, or it must be   <math-italic x><dot accent>
namely:   "1D465"0307
using the  "Math Alphanumeric Symbols" plane,
as in the  Code2001  font.
None of the Apple fonts have these characters, as far as I know.

Also, XeTeX cannot handle code-points that high:

>> ! Bad character code (119909).
>> <to be read again>
>>                    \char
>> l.33 test \char"01D465\char
>>                            "0308
>> ?

So Jonathan, how shall we proceed to implement mathematics
properly ?

Indeed, what does *properly* actually mean now ?



> W
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex

Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                             fax: +61 +2 9850  

More information about the XeTeX mailing list