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

Ross Moore ross.moore at mq.edu.au
Mon Nov 28 21:57:13 CET 2011


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!

> 
> I'm not much of an expert in the inner workings of TeX and I know
> absolutely nothing about Lua (is that a derivative of LISP?) so I
> can't comment on whether the luacolor package could be ported to
> XeTeX.

I'd doubt that this could work currently.

My guess is that you would need to do some post-processing
of the PDF code snippet returned from the OS positioning
the glyphs. Once positioned, you would need to wrap the colour
commands around the part which places the diacritic.


> Any insights?

But XeTeX currently does not give you access to that PDF string,
and it is well past the place of macro-expansion in LaTeX, so 
there wouldn't be a mechanism for such late adjustments.

It can be done with LuaTeX, since it does have the appropriate
mechanism for such post-processing.

Others more familiar with how LuaTeX works can confirm this
explanation -- or shoot it down, as appropriate.


> Aleks


Hope this helps,

	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