[XeTeX] glyph index

Jonathan Kew jonathan at jfkew.plus.com
Tue Jan 20 14:07:19 CET 2009


On 20 Jan 2009, at 12:42, franÿffffe7ois franc wrote:

> Hi Jonathan,
> sorry, if I confused between character code and glyph index. but I  
> think that it's a problem of plain tex itself -not xetex-. So I mean  
> the character code, the second field in the char_node.
>
> I'm using OT font.
>
> in the xetex process I'm trying to substitute a glyph1 by glyph2 if  
> the glyph1 occurred in a certain context, and I want that this  
> contextual analysis to be independent of the font engine. So, I  
> think that I should process in native_word_node, and I should get  
> the glyph1 ID and replace it by glyph2 ID.
>
> thanks for help.


(Please keep the discussion on the mailing list rather than emailing  
me personally, so that others may participate, as well as for the sake  
of the archives.)

Do you mean that you're trying to modify the (C or Pascal) code of  
xetex itself to do this, or you're trying to do it at the TeX macro  
level? Do you really mean that you want to substitute one *glyph* for  
another, or do you want to substitute a *character* in a certain  
context? Maybe you could give a real-life example to make it clear  
what you're trying to achieve.

Anything you do with glyphs will necessarily be tied to a particular  
font engine and indeed a particular font. Glyph IDs are completely non- 
portable, and there are no guarantees about the mapping from  
characters to glyphs. You can't even be sure how many glyphs will be  
generated for a particular character sequence, unless you know the  
details of the font you're using, how the text engine implements the  
layout process, and which font features are in effect.

It's still not clear to me exactly what you want to do, but it sounds  
like maybe you're trying to override the character-to-glyph mapping  
and/or layout features in the font. You can't really do that in XeTeX,  
unless you abandon the opentype layout process altogether and simply  
use \XeTeXglyph to print the glyphs you want in the places you want  
them.

You'd probably be better off modifying the font itself so that it  
behaves in the way you want, rather than trying to work around it like  
this.

JK



More information about the XeTeX mailing list