[XeTeX] Diacritics in color (was Re: XETEX cannot access OpenType features in PUA?)
Ross Moore
ross.moore at mq.edu.au
Tue Nov 29 20:23:54 CET 2011
Hi Heiko,
On 29/11/2011, at 9:29 AM, Heiko Oberdiek wrote:
> The same also works in XeLaTeX:
>
> \documentclass{minimal}
> \usepackage{fontspec}
> \usepackage{color}
> \pagestyle{empty}
>
> \begin{document}
> \fontsize{100pt}{100pt}\selectfont
> \noindent
> ^^^^00e4\\
> a^^^^0308\\
> a\textcolor{red}{^^^^0308}
> \end{document}
>
> stream
> q 1 0 0 1 72 769.89 cm 0 G 0 g 0 G 0 g 0 G 0 g BT /F1 99.626 Tf 0 -63.86
> Td[<00a0>]TJ 0 -99.63 Td[<001c00ee>]TJ 0 -99.62 Td[<001c>]TJ ET 1 0 0 RG 1
> 0 0 rg BT /F1 99.626 Tf 45.73 -263.11 Td[<00ee>]TJ ET 0 G 0 g 0 G 0 g 0 G
> 0 g Q
>
> endstream
Yes, this is OK with lower-case letters.
But try with uppers:
\begin{document}
\fontsize{100pt}{100pt}\selectfont
\noindent
^^^^00e4\\
a^^^^0308\\
a\textcolor{red}{^^^^0308}\"a
U\textcolor{red}{^^^^0308}\"U
\end{document}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: texshop_image.jpeg
Type: image/jpeg
Size: 60966 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20111130/ac71bb2c/attachment-0001.jpeg>
-------------- next part --------------
Both the vertical and horizontal position are now wrong.
stream
q 1 0 0 1 72 769.89 cm 0 G 0 g 0 G 0 g 0 G 0 g BT /F1 99.626 Tf 0 -63.86 Td[<00a0>]TJ 0 -99.63 Td[<001c00ee>]TJ 0 -99.62 Td[<001c>]TJ ET 1 0 0 RG 1 0 0 rg BT /F1 99.626 Tf 45.73 -263.11 Td[<00ee>]TJ ET 0 G 0 g BT /F1 99.626 Tf 45.73 -263.11 Td[<00a0>-301<006c>]TJ ET 1 0 0 RG 1 0 0 rg BT /F1 99.626 Tf 190.59 -263.11 Td[<00ee>]TJ ET 0 G 0 g BT /F1 99.626 Tf 190.59 -263.11 Td[<0242>]TJ ET 0 G 0 g 0 G 0 g Q
endstream
Note also that those <HEX> codes are glyph IDs, not Unicode points.
There is a CMap that decodes these.
5 beginbfchar
<001C> <0061> % a
<006C> <0055> % U
<00A0> <00E4> % ?
<00EE> <0308> % ??
<0242> <00DC> % ?
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
It is not at all clear how to obtain correct positioning
information for the coloured glyph, and put it in place
once known.
One would hope to not have to go back to positioning the
accent in its own box, above the character --- ensuring that
it comes later, rather than earlier, within the PDF stream.
Maybe this *is* the only way to go?
Also, you cannot start with the precomposed glyph (<0242> here)
without also having the knowledge of how to decompose(!) it.
>
> Yours sincerely
> Heiko Oberdiek
Cheers,
Ross
------------------------------------------------------------------------
Ross Moore ross.moore at 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