[XeTeX] wrong alignment with optical bounds

Jonathan Kew jfkthame at googlemail.com
Sat Oct 10 21:10:34 CEST 2009


On 10 Oct 2009, at 18:45, Pablo Rodríguez wrote:

> Hi Jonathan and others,
>
> I have just tried the following code:
>
> \documentclass[12pt]{article}
> \usepackage[a5paper]{geometry}
> \usepackage{fontspec}
> \setromanfont[RawFeature=-liga]{Grandjean Baskerville}
> \begin{document}
> \begin{verse}
> Ἔνοιωσεν ὅτι\\
> τοῦ ἦσαν οἱ στίχοι\\
> ἄχαρη τύχη\\
> καὶ ματαιότη.
> \end{verse}
>
> \fontspec[RawFeature=+opbd;-liga]{Grandjean Baskerville}
> \begin{verse}
> Ἔνοιωσεν ὅτι\\
> τοῦ ἦσαν οἱ στίχοι\\
> ἄχαρη τύχη\\
> καὶ ματαιότη.
> \end{verse}
> \end{document}
>
> And the result can be located at http://www.ousia.tk/a.pdf. XeTeX is
> applying the optical bound to the first letter in text, but it also
> creates a kind of positive kerning with the next letter.
>
> I guess this might be a bug.

I'm afraid you're trying to do something that simply isn't supported.  
The OpenType features for optical bounds require the application to  
apply different lookups depending on where the glyph occurs on the  
line, but xetex does not support this; it applies the features you  
specify to the entire run of text, *before* line-breaking decisions  
have been made, so it cannot apply them contextually depending whether  
the glyph is actually at the start of line in the finished paragraph.

The spacing after the initial Ἔ in your PDF does look odd; this may  
have something to do with the type of OpenType lookup that has been  
used in that font. This may well be a bug. However, regardless of  
that, I don't think you can usefully use OT features in this way at  
the moment. Consider what would happen if a word beginning with Ἔ  
occurred in the middle of a line: it would end up intruding into the  
preceding inter-word space, because the feature is being applied  
indiscriminately.

JK



More information about the XeTeX mailing list