[XeTeX] Diacritics in color (was Re: XETEX cannot access OpenType features in PUA?)

Heiko Oberdiek heiko.oberdiek at googlemail.com
Mon Nov 28 23:29:43 CET 2011


On Tue, Nov 29, 2011 at 07:57:13AM +1100, Ross Moore wrote:

> Hi Aleks,
> 
> On 29/11/2011, at 6:18 AM, Aleksandr Andreev wrote:
> 
> > Jonathan Kew writes:
> > 
> >>> Making this work in xetex would require a different approach to implementing color.
> > 
> > I have been able to get it to work (the base glyph in black and the
> > "diacritic" in red) in LuaTeX using the luacolor package.
> > 
> > Here's a minimal example:
> > 
> > \documentclass{minimal}
> > \usepackage{fontspec}
> > \usepackage{xcolor}
> > \usepackage{luacolor}
> > 
> > \newfontface\moo{MezenetsUnicode}
> > 
> > \begin{document}
> > \moo
> > \textcolor{red}{}
> > \end{document}
> 
> Would you be so kind as to post the PDF from this?
> And where does one obtain the font MezenetsUnicode ?
>  --- Google gives nothing with this name.
> 
> Furthermore my LuaTeX gives a Segmentation Fault, so I cannot
> just try with a different font!

Example for LuaTeX:

pdfobjcompresslevel=0
\pdfcompresslevel=0
\documentclass{minimal}
\usepackage{fontspec}
\usepackage{luacolor}
\pagestyle{empty}

\begin{document}
\fontsize{100pt}{100pt}\selectfont
\noindent
^^^^00e4\\
a^^^^0308\\
a\textcolor{red}{^^^^0308}
\end{document}

Page contents stream:

  stream
  0 g 0 G
  BT
  /F20 99.6264 Tf 1 0 0 1 72 706.029 Tm [<00A0>]TJ
  1 0 0 1 72 606.403 Tm [<001C00EE>]TJ
  1 0 0 1 72 506.776 Tm [<001C>]TJ
  1 0 0 rg 1 0 0 RG
  1 0 0 1 117.729 506.776 Tm [<00EE>]TJ
  ET
  endstream

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

Yours sincerely
  Heiko Oberdiek


More information about the XeTeX mailing list