5

Using Xe(La)TeX, how could the hyphenation character be set to any particular glyph in a given font? I'd also like to have the possibility to set a color for the glyph when used for that task and to set the glyph's size, too.

I am thinking of using some ornamental glyph as hyphenation character, but haven't figured out how to put to good use the facilities of the package fontspec to this end. I've tried with the key HyphenChar, but I wasn't able to set a value in terms of XeTeXglyph when I found a glyph not corresponding to any UniCode number; besides, I had no chance to set either color or size.

  • You can't express the character by the font specific slot where the character happens to live (which is the purpose of \XeTeXglyph, but only by itself or by Unicode code point. – egreg Sep 12 '12 at 20:01
3

The character used for marking hyphenation must be chosen by its Unicode point, not with \XeTeXglyph.

So, if you're able to find the code point of the glyph, suppose it is U+1234, you can say

\setmainfont[Ligatures=TeX,HyphenChar="1234]{MyFont}

However you will not be able to change its color or size, even with the \XeTeXinterchartoks feature, because this is executed at an earlier stage than hyphenation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.