[XeTeX] Diacritics in color
Khaled Hosny
khaledhosny at eglug.org
Wed Nov 30 04:10:07 CET 2011
On Wed, Nov 30, 2011 at 02:09:47AM +0100, Heiko Oberdiek wrote:
> On Wed, Nov 30, 2011 at 10:58:23AM +1100, Ross Moore wrote:
>
> > On 30/11/2011, at 10:32 AM, Heiko Oberdiek wrote:
> >
> > > or
> > > ^^^^00c4\\
> > > A^^^^0308\\
> > > A\textcolor{red}{^^^^0308}
> > >
> > > As you can see, this problem is not related to color,
> > > both XeTeX and LuaTeX fail:
> >
> > With this font (Latin Modern) yes. I noticed this too.
> >
> > But try switching the font:
> >
> > \documentclass{minimal}
> > \usepackage{fontspec}
> > \usepackage{color}
> > \pagestyle{empty}
> >
> > \setmainfont{Charis SIL}
> >
> > \begin{document}
> > \fontsize{100pt}{100pt}\selectfont
> > \noindent
> > ^^^^00e4\\
> > a^^^^0308\\
> > a\textcolor{red}{^^^^0308}\"a
> > \hbox{U^^^^0308} U\textcolor{red}{^^^^0308}\"U
> >
> > ^^^^00c4\\
> > A^^^^0308\\
> > A\textcolor{red}{^^^^0308}
> >
> > \end{document}
> >
> >
> > Now it *does* depend upon having the color commands.
>
> \documentclass{minimal}
> \usepackage{ifluatex}
> \usepackage{fontspec}
> \ifluatex
> \usepackage{luacolor}
> \pdfobjcompresslevel=0
> \pdfcompresslevel=0
> \else
> \usepackage{color}
> \fi
>
> \pagestyle{empty}
>
> \setmainfont{CharisSIL-R.ttf}
>
> \begin{document}
> \fontsize{100pt}{100pt}\selectfont
> \noindent
> ^^^^00c4\\ % (1)
> A^^^^0308\\ % (2)
> A\textcolor{red}{^^^^0308}\\ % (3)
> A\textcolor{red}{\hbox{^^^^0308}} % (4)
> \end{document}
>
> * LuaTeX: "A" + U+0308 gets combined to one glyph U+00C4, the
> color attribute of the diaeresis vanishes and the result is
> black (3). In the last line (4) \hbox prevents the recombination
> and the diaeresis is red, but misplaced.
It seems Charis SIL composes accented glyphs, try Gentium Basic instead
(GenBasR.ttf).
Regards,
Khaled
More information about the XeTeX
mailing list