[NTG-context] (bug?) wrong interline in \placelist[alternative=d] with Pagella italics

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Sun Mar 15 22:56:46 CET 2020


Pablo Rodriguez schrieb am 15.03.2020 um 20:32:
> Hi Hans,
> 
> here you have the sample:
> 
>      \setuppapersize[A6]
>      \setupinteraction[state=start]
>      \enabledirectives[references.border]
> 
>      \setupbodyfont[pagella]
> 
>      \starttext
> 
>      \placelist[section]
>          [alternative=d,
>           style=\it]
> 
>      \section{Section 1}
>      \section{\dorecurse{25}{Section }3}
>      \section{Section 3}
>      \stoptext
> 
> For some strange reason (at least, to me), \placelist[alternative=d]
> seems to misbehave when using \it or \bi as style.
> 
> Everthing is fine when italic fonts aren’t used.

It can be fixed with a strut option for lists, e.g. 
\setuplist[strut=no]. The problem in this case is that the ex-height for 
the italic font is larger than the ex-height for the upright font which 
pushes the text down because add a strut at the begin and end of the 
entries.

Below is a minimal example of the problem, the \setstrut setting changes 
the height of the strut for the italic font.

%%%% begin example
\showstruts

\setupbodyfont[pagella]

\starttext

\dontleavehmode\it
\ruledhbox{\strut Section}
\ruledhbox{\setstrut\strut Section}

\stoptext
%%%% end example

Most fonts (I checked only a small number) don't have such a big 
difference between the ex-height of the upright and italic styles which 
makes it hard to notice the problem.

%%%% begin example
\define[1]\ShowExheight
   {\bgroup
    \setupbodyfont[#1]
    \subject{#1}
    \starttabulate
    \NC tf \NC \tf \the\exheight \NC\NR
    \NC it \NC \it \the\exheight \NC\NR
    \NC bf \NC \bf \the\exheight \NC\NR
    \NC bi \NC \bi \the\exheight \NC\NR
    \stoptabulate
    \egroup}

\starttext

\ShowExheight{pagella}
\ShowExheight{modern}
\ShowExheight{dejavu}
\ShowExheight{termes}

\stoptext
%%%% end example

Wolfgang


More information about the ntg-context mailing list