[XeTeX] On combining diacritics again

Jonathan Kew jonathan_kew at sil.org
Mon Jun 11 22:02:37 CEST 2007


On 11 Jun 2007, at 5:50 am, Florian Grammel wrote:

> Wouldn't it be very practical -- as there are so few fonts with the
> proper AAT-support -- to make XeTeX imitate Cocoa's font-behaviour,
> as least when one needs it? As I understand from Jonathan's
> explanations, this isn't feasible on the font-engine level. But might
> be somebody with a better understanding of TeX than me could suggest
> how one could solve this with a sort of macro? When meeting a glyph
> from a certain list (e.g. a combining diacritic), this macro would
> read the dimensions of the antecedent glyph-box and would "kern" the
> diacritic, so that it a) is placed centred in relation to the box and
> b) outside of it.

I don't believe this is possible at the TeX macro level, except  
through incredibly complex/ugly schemes that would involve making the  
*base characters* active and then programming them to look ahead for  
diacritics. You really, really don't want to even consider such a thing.

You can't do it just by programming the diacritics, because you can't  
"look back" at the preceding character.

>
> If none of the experts can be tempted to waste some of their spare
> time to solve this probably not too trivial problem -- I still will
> be looking for a handy way to adjust the placement without fiddling
> with the font itself. I would prefer not to alter the text itself,
> but define the changed placement (vertically or horizontally
> respectively) for a given pair of glyphs once and for all in the
> preamble.
>
>
> I would be very grateful for any help to get my diacritics to behave!

As I understand it, you want your text to contain simple Unicode  
sequences of <base, diacritic(s)>, and have the diacritic(s)  
positioned properly. The appropriate way to solve this is by building  
the behavior into the font. For Latin-script text and all common (and  
many uncommon) diacritics, fonts like Doulos SIL, Charis SIL, or  
Microsoft's new Core fonts in Vista provide this support.

However, you mentioned needing to use PUA characters from a special  
font. Is this a font that you own and can modify, or can you persuade  
the font developer to work on it? If so, the solution is to use VOLT  
(Microsoft's OpenType font development tool, available free) to add  
attachment points and "mark" and "mkmk" features to the font, so that  
the ICU OpenType engine will automatically position the diacritics  
properly. It's not very hard to do this -- easier (I would say) than  
advanced TeX macro programming! -- and it will work transparently  
without the risk of conflicting with other macros or markup in your  
document.

JK





More information about the XeTeX mailing list