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

2016-04-12 Thread Hans Hagen

On 4/12/2016 6:42 PM, mass...@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?


per font instance, so you can selectively use it


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

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

2016-04-12 Thread Hans Hagen

On 4/12/2016 6:42 PM, mass...@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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

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

2016-04-12 Thread massifr
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?
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

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

2016-04-11 Thread Hans Hagen

On 4/11/2016 11:29 AM, mass...@fastwebnet.it wrote:

Hello list,
I'm typesetting italian text that contains "E" letters with a grave accent,
like this: "È".

In my "body font environment" the interline space is narrow and those
"È" make their lines taller, making every following line move downwards.

The problem is easily solvable putting "\smash" before "È".

But my sources are XML and typesetting is done through xmlsetups,
so I'm looking for an automatic way to replace every "È" in the text
with "\smash{È}".
Is it possible?


\definefontfeature[default][default][dimensions={0,1.9,0}]

\starttext
\showglyphs
\strut g È\par
\strut g E\par
\strut g È\par
\strut g E\par
\strut g È\par
\strut g E\par
\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

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

2016-04-11 Thread massifr
Hello list,
I'm typesetting italian text that contains "E" letters with a grave accent, 
like this: "È".

In my "body font environment" the interline space is narrow and those
"È" make their lines taller, making every following line move downwards.

The problem is easily solvable putting "\smash" before "È".

But my sources are XML and typesetting is done through xmlsetups,
so I'm looking for an automatic way to replace every "È" in the text 
with "\smash{È}".
Is it possible?

Thanks, Massi

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___