[XeTeX] access to composite characters

musa furber musaf at runbox.com
Wed Nov 2 18:17:37 CET 2005


On Nov 2, 2005, at 3:48 PM, Jonathan Kew wrote:

> [...]
> Using a font that actually supports the Unicode characters you want  
> to use will mean that the PDF you create contains correct Unicode  
> data, which you can copy and paste, search, etc.
>
> You can "fake it" by centering a period under the letter, for  
> example, using macros such as those Musa has posted -- but the  
> results may be less than ideal, unless you're prepared to spend the  
> time tinkering with positioning until you get it exactly how you  
> want. And although the result may look correct, it's less useful  
> because you can hardly expect a PDF reader to successfully search  
> for a word containing such a "faked" character, or Spotlight to  
> index it properly, etc.
>

For what it's worth, stuff before the document preamble is what I  
sometimes use for getting the various under-dotted letters I need for  
transliterating Arabic. Jonathan provided a basic template that I  
extended for my needs.

#####

\documentclass[11pt]{article}
\usepackage{fontspec}
\def\dotbelow#1{\leavevmode \vtop{\offinterlineskip \ialign{##\cr #1\cr
   \setbox0=\hbox{\raise.15ex\hbox{.}}\ht0=0pt\dp0=0pt\hidewidth\box0 
\hidewidth\cr}}}

\catcode"1E0C=\active \def^^^^1e0c{\dotbelow{D}}
\catcode"1E0D=\active \def^^^^1e0d{\dotbelow{d}}
\catcode"1E24=\active \def^^^^1e24{\dotbelow{H}}
\catcode"1E25=\active \def^^^^1e25{\dotbelow{h}}
\catcode"1E62=\active \def^^^^1e62{\dotbelow{S}}
\catcode"1E63=\active \def^^^^1e63{\dotbelow{s}}
\catcode"1E6C=\active \def^^^^1e6c{\dotbelow{T}}
\catcode"1E6D=\active \def^^^^1e6d{\dotbelow{t}}
\catcode"1E92=\active \def^^^^1e92{\dotbelow{Z}}
\catcode"1E93=\active \def^^^^1e93{\dotbelow{z}}

\begin{document}

\setromanfont[ItalicFont={MinionPro-It}]{Minion Pro}

Minion Pro

Normal text. Ḍḍ Ḥḥ Ṣṣ Ṭṭ Ẓẓ Āā Īī Ūū

\emph{Normal text. Ḍḍ Ḥḥ Ṣṣ Ṭṭ Ẓẓ Āā Īī Ūū}

\bigskip

Hoefler Text

\setromanfont{Hoefler Text}
Normal text. Ḍḍ Ḥḥ Ṣṣ Ṭṭ Ẓẓ Āā Īī Ūū

\emph{Normal text. Ḍḍ Ḥḥ Ṣṣ Ṭṭ Ẓẓ Āā Īī Ūū}

\end{document}

#####

It produces
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedGraphic.pdf
Type: application/pdf
Size: 20644 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20051102/a327b877/pastedGraphic-0001.pdf
-------------- next part --------------

The dot placement with Minion for both roman and italics are good  
enough for my simple needs. Hoefler doesn't work as well; the dot  
needs to be nudged a bit, and "a bit" differs from glyph to glyph and  
from style to style.

Regards,
Musa



More information about the XeTeX mailing list