[XeTeX] Controlling glyph variations

Mark Dancer mark.david.dancer at gmail.com
Fri Nov 9 05:03:35 CET 2007


On 30 Oct 2007, at 23:10, Will Robertson wrote:

> On 30/10/2007, at 22:12 , Mark Dancer wrote:
>>
>>>>     \newcount\nglyph
>>>>     \newcount\glyf \newcount\step
>>>>     \nglyph =\XeTeXcountglyphs\varfont
>>>>     \noindent{\title Zapfino First Variant Glyph Set
>>>> contains \number\nglyph\ glyphs}
>>>>     \nobreak\medskip
>>>>     \noindent
>>>>         \loop \advance\glyf by 1
>>>>             \ifnum\glyf<\nglyph
>>>>                 {\varfont\XeTeXglyph\glyf }
>>>>         \repeat
>>
>> gives me every variant of every character
>
>> Thanks for pointing me in the right direction.
>
> We'll see! I'm interested to find out what your results are.

Haven't had any great success with this. I think this is largely due  
to my originally misunderstanding what TeX is (and isn't), and  
wanting it to do things it isn't designed for. What I wanted to do is  
something like the following:

     for each character code:
         if there is a glyph in the base glyph set:
             print the base glyph
             for each alternate glyph set:
                 if the glyph in the alternate glyph set is not the  
same as the base glyph:
                     print the alternate glyph

Where this all breaks down is that TeX is essentially a one-way  
processes--when you produce the glyph, it's immediately put on the  
paper and not available for testing.

There are some other areas where a page layout program like InDesign  
is going to make this whole project easier than a TeX-based system-- 
this isn't a criticism of TeX, just saying that a very good hammer is  
still the wrong tool to use to tighten screws--so I won't be pursuing  
this.

Mark Dancer
mark.dancer at pobox.com





More information about the XeTeX mailing list