[NTG-context] automatically "smashing" È in xml typesetting

Hans Hagen pragma at wxs.nl
Tue Apr 12 21:56:38 CEST 2016


On 4/12/2016 6:42 PM, massifr at fastwebnet.it wrote:
> Thank you Hans for your example:
>
>>> so I'm looking for an automatic way to replace every "È" in the text with "\smash{È}".
>>
>> \definefontfeature[default][default][dimensions={0,1.9,0}]
>>
>
> It took a while to understand how it works but it was worthy.
>
> I try to summarize because others may find it useful:
> - the "dimensions" feature is defined in font-ext.lua
> - its parameters modify the footprint of the glyphs of a font
> - its parameters are factors for glyph's width, height (over the baseline) and depth (under the baseline)
> - they are factors of emwidth, exheight and exheight respectively
> - a value of zero for any of them means "leave the default value untouched",
>    dimensions={0,1.9,0} means that only the height of (the footprint of) glyphs is set to 1.9 times exheight,
>    the other two dimensions stay untouched
>
> Before looking at the code I started playing with the dimensions values
> to understand what they controlled. One trial was this
>
> \definefontfeature[default][default][dimensions={2,0,0}]
>
> I got "spaced" text (glyphs have a larger footprint and appear spaced)
>
> But this does not work:
>
> \definefontfeature[spaced][dimensions={2,0,0}]
> \starttext
> Normal text and {\feature[+][spaced]spaced text}
> \stoptext
>
> Is it a feature that works only globally?

indeed, this feature gets applied to the glyphs and from then on tex 
uses those dimensions

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list