[XeTeX] Faking an accent when that glyph is unavailable

Ross Moore ross at ics.mq.edu.au
Thu Apr 9 05:33:19 CEST 2009


Hello Henry,

On 09/04/2009, at 11:19 AM, Henry de Valence wrote:

> I'm writing a document using a font (Aldus LT Std) that doesn't  
> contain the
> character ő (U+0151, LATIN SMALL LETTER O WITH DOUBLE ACUTE).
>
> However I need to use the name "Erdős", and I don't want to use  
> just a normal
> umlaut, because that would be wrong. I have already tried using \H 
> {o} and
> simply 'ő' in the source, but they don't work because the font is  
> missing that
> glyph. I found that the font does have a character for just the accent
> (U+02DD), but I don't know how to get that character or how to put  
> it over top
> of the 'o'. Text-searchability isn't a big issue, because I'm just  
> going to
> print it anyways, so something that looks roughly correct would  
> work fine.

Just printing the  U+02DD  isn't going to do what you want.

You will get   Erdo˝s
whereas you want   Erdős
using the  U+030B  combining accent.

Provided
  1.  your font has  U+030B  as well as  U+02DD ,
and
  2.  you are loading the   xunicode.sty   package,

then the most elegant way to get  ő  is to put
a line in your preamble:

    \UndeclareUTFcomposite[\UTFencname]{x0151}{\H}{o}

This command will tell LaTeX to *not* use the  U+0151 character
for  \H{o}  but to fall back to using  o + U+030B  instead.

Thus you do not have to define your own accenting macros,
and you do not need to know the unicode points for the characters
or accents that you want to use;
that is,   xunicode  has it all programmed-in.

That is,  if you do the command:

    grep "H}{o" `kpsewhich xunicode.sty`

you'll see:

    \DeclareUTFcomposite[\UTFencname]{x0151}{\H}{o}

This is the command whose effect you nullify, using

    \UndeclareUTFcomposite[\UTFencname]{x0151}{\H}{o}

Do the same kind of thing for other accent combinations
that do not work with your particular font(s).

>
> I have tried the following:
> Erdo\XeTeXglyph"02dd" s
> but it just produces the following text:
> Erdo!dd˝ s
> which is clearly not what I want.
>
> If anyone knows of a way to fake this, advice would be welcome.

No need to fake anything.  Just modify what  xunicode.sty  has setup,
to match what your font can provide.

> Thanks,
> Henry de Valence


Hope this helps,

	Ross

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





More information about the XeTeX mailing list