[XeTeX] adding some diacritics to a font

Ross Moore ross at ics.mq.edu.au
Wed Jan 7 01:33:03 CET 2009


Hi Peter,

On 07/01/2009, at 10:20 AM, Peter Dyballa wrote:

> In short: I'd use for maths mathdesign and for text I'd use a regular
> fontspec font. And this font can be your Garamond Premier Pro! And in
> case you don't see any character with a dot below: remove
> xunicode.sty from the packages you use!

No; don't do this ...

> Xunicode.sty translates
> typical LaTeX constructs like \d{n} to their real Unicode value. And
> if the font does not have a glyph at this position, then you'll see
> an OPEN BOX character, I think. Without xunicode.sty XeLaTeX will
> work like LaTeX and construct the final character from two (or more),
> and this construct will be unsearchable.

Wrong. It depends what encoding you are using, and what special
macros have been declared for accented character using this encoding.

> And without xunicode.sty
> other things will fail, presumingly ... So it would be nice if one
> could switch off xunicode.sty for certain constructs!

    ... because you can indeed do this!!

  xunicode.sty  has commands especially for this purpose:
viz. (comments inside  xunicode.sty )

% ... or use \UndeclareUTFcharacter to cancel a declaration
% when the appropriate code-point is not supported in the
% desired text-font.
%

%
% ... or use \UndeclareUTFcomposite to cancel a declaration
% when the appropriate code-point is not supported in the
% desired text-font.
%


Use the latter as follows.
Where  xunicode.sty  has a line

    \DeclareUTFcomposite[\UTFencname]{x1E47}{\d}{n}

After loading the package, simply include in your preamble:

    \UndeclareUTFcomposite[\UTFencname]{x1E47}{\d}{n}

(Copy the \Declare... line from  xunicode.sty  and
  change the letters at the start of the macro-name.)
\UndeclareUTFcharacter  works the same way.


Now \d{n}  will produce:  U+006E;U+0323;
which is 'n' followed by the combining dot-below accent.

However, if your font doesn't have ṇ then it probably
doesn't have the combining dot-below accent either.
It which case this hasn't really helped at all.



To revert to LaTeX's old way of doing accents, by placing
two glyphs instead of one, you can simply change the encoding;
e.g.

{\fontencoding{OT1}\selectfont
   \d{n}}

In practice, you would build this into a macro; e.g. for
choosing the font that you need for these accented characters.
Or you could build a macro such as:

\newcommand{\dotbelow}[1]{{fontencoding{OT1} ... \selectfont\d{#1}}}

where the ... means whatever else you need to get the correct font.




The point of all this is that xunicode *does* use LaTeX's
font-handling mechanism.
It simply defines expansions within the  EU1  encoding.
If you switch to other encodings then you can get different
results from the same LateX input source.


>
> --
> Greetings
>
>    Pete

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