ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* automatically "smashing" È in xml typesetting
@ 2016-04-11  9:29 massifr
  2016-04-11 14:44 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: massifr @ 2016-04-11  9:29 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:  automatically "smashing" È in xml typesetting
  2016-04-11  9:29 automatically "smashing" È in xml typesetting massifr
@ 2016-04-11 14:44 ` Hans Hagen
  2016-04-12 16:42   ` massifr
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2016-04-11 14:44 UTC (permalink / raw)
  To: ntg-context

On 4/11/2016 11:29 AM, massifr@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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:  automatically "smashing" È in xml typesetting
  2016-04-11 14:44 ` Hans Hagen
@ 2016-04-12 16:42   ` massifr
  2016-04-12 19:56     ` Hans Hagen
  2016-04-12 19:57     ` Hans Hagen
  0 siblings, 2 replies; 5+ messages in thread
From: massifr @ 2016-04-12 16:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:  automatically "smashing" È in xml typesetting
  2016-04-12 16:42   ` massifr
@ 2016-04-12 19:56     ` Hans Hagen
  2016-04-12 19:57     ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2016-04-12 19:56 UTC (permalink / raw)
  To: ntg-context

On 4/12/2016 6:42 PM, massifr@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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:  automatically "smashing" È in xml typesetting
  2016-04-12 16:42   ` massifr
  2016-04-12 19:56     ` Hans Hagen
@ 2016-04-12 19:57     ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2016-04-12 19:57 UTC (permalink / raw)
  To: massifr, mailing list for ConTeXt users

On 4/12/2016 6:42 PM, massifr@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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-12 19:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11  9:29 automatically "smashing" È in xml typesetting massifr
2016-04-11 14:44 ` Hans Hagen
2016-04-12 16:42   ` massifr
2016-04-12 19:56     ` Hans Hagen
2016-04-12 19:57     ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).