[XeTeX] Color Hebrew Vowel Points
jonathan_kew at sil.org
Tue Jul 24 22:01:26 CEST 2007
On 24 Jul 2007, at 6:32 pm, Joshua Grauman wrote:
> I've been trying to create some Hebrew charts (using SIL's Ezra 2.5
> Unicode font) and I'm having difficulty coloring the vowel points a
> different color than the consonants they are on. If I color them
> colors, the vowel points are no longer positioned correctly (they
> move to
> the left side of the consonant). What is interesting is that the exact
> same behavior is displayed in OpenOffice 2.2.0, Qt 4.3.0 QTextEdit,
> XeTeX 0.996 (I'm using a texlive 2007 install on Linux). I had just
> to create a few charts in OpenOffice, but when that didn't work was
> to find any way to color vowels and their consonants differently.
> Is this
> even possible with Unicode fonts?
In theory, it could be possible; in practice, I am not aware of any
current rendering engine that will support this. When you apply a
different color to the diacritics, you are breaking the text into
separate "style runs" (or whatever the particular implementation
calls them), and shaping rules (including the mark positioning that
is used for the diacritics in Ezra SIL) are applied separately to the
runs. So the diacritics no longer "see" the base consonants that you
want to position them on.
MS Word in Windows has an option to "color diacritics", which might
come close, but even that will fail whenever the font implements a
particular base+diacritic combination using a single composite glyph.
And that's a global option, not something you can apply to specific
fragments of text within a document (it's not implemented at the
level of individual character styling at all).
You could of course produce your charts in XeTeX by writing custom
macros that tweak the diacritic positions as needed, but that would
be a pretty tedious job for more than a handful of cases.
Or you could create a couple of customized versions of the font, one
where all the consonant glyphs are replaced by blanks (with the exact
same metrics), and another where the vowels are similarly removed.
Then you could set the text twice, once with each font, using
different colors, and overlay the two versions. :-)
Actually, that gives me an idea: assuming the presence of the vowels
does not affect the positioning of the consonants at all (is this the
case?), you could simply print the vowelled text in one color, and
then overprint with the consonants only in a second color. Might be
worth a try!
More information about the XeTeX