(bug?) wrong interline in \placelist[alternative=d] with Pagella italics
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. I’m afraid I may be hitting a bug in both latest MkXL from 2020.03.10 14:52 and MkIV from 2019.07.24 11:31. Many thanks for your help, Pablo -- http://www.ousia.tk
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
On 3/15/20 10:56 PM, Wolfgang Schuster wrote:
Pablo Rodriguez schrieb am 15.03.2020 um 20:32:
[...] 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.
Many thanks for your reply, Wolfgang. I don’t get \setuplist[strut=no] working in the minimal sample I sent yesterday.
Below is a minimal example of the problem, the \setstrut setting changes the height of the strut for the italic font.
I must admit that I don’t understand how to handle struts (I’m not sure I understand what they actually are.)
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.
Yesterday I realized that Pagella was an extreme case, because I tried to report this issue before, but Latin Modern didn’t show the issue (so I thought I was doing something wrong). Many thanks for your help, Pablo -- http://www.ousia.tk
Pablo Rodriguez schrieb am 16.03.2020 um 10:01:
On 3/15/20 10:56 PM, Wolfgang Schuster wrote:
Pablo Rodriguez schrieb am 15.03.2020 um 20:32:
[...] 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.
Many thanks for your reply, Wolfgang.
I don’t get \setuplist[strut=no] working in the minimal sample I sent yesterday.
The key isn't supported yet but it could help to avoid the spacing problem.
Below is a minimal example of the problem, the \setstrut setting changes the height of the strut for the italic font.
I must admit that I don’t understand how to handle struts (I’m not sure I understand what they actually are.)
The simple answer is that a strut is a invisible vertical line with the height and depth of a line. When you look at the example below you can see the text in the first box touches the top and bottom boundaries. When we add a strut at the begin and end of the text we ensure the last line has the depth of a normal line and the first line gets the complete height of a line. %%%% begin example \starttext \ruledvbox{\samplefile{weisman}} \blank \ruledvbox{\begstrut\samplefile{weisman}\endstrut} \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.
Yesterday I realized that Pagella was an extreme case, because I tried to report this issue before, but Latin Modern didn’t show the issue (so I thought I was doing something wrong).
Yes, pagella is a extreme case but when you use bold text the vertical spacing is also messed up. You can avoid this when you use a fixed lineheight (e.g. \setupinterlinespace[line=14pt]) because the default distance is font dependant (default: 2.8 * ex-height). Wolfgang
On 3/16/2020 1:27 PM, Wolfgang Schuster wrote:
Pablo Rodriguez schrieb am 16.03.2020 um 10:01:
On 3/15/20 10:56 PM, Wolfgang Schuster wrote:
Pablo Rodriguez schrieb am 15.03.2020 um 20:32:
[...] 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.
Many thanks for your reply, Wolfgang.
I don’t get \setuplist[strut=no] working in the minimal sample I sent yesterday.
The key isn't supported yet but it could help to avoid the spacing problem.
Below is a minimal example of the problem, the \setstrut setting changes the height of the strut for the italic font.
I must admit that I don’t understand how to handle struts (I’m not sure I understand what they actually are.)
The simple answer is that a strut is a invisible vertical line with the height and depth of a line. When you look at the example below you can see the text in the first box touches the top and bottom boundaries.
When we add a strut at the begin and end of the text we ensure the last line has the depth of a normal line and the first line gets the complete height of a line.
%%%% begin example \starttext
\ruledvbox{\samplefile{weisman}}
\blank
\ruledvbox{\begstrut\samplefile{weisman}\endstrut}
\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.
Yesterday I realized that Pagella was an extreme case, because I tried to report this issue before, but Latin Modern didn’t show the issue (so I thought I was doing something wrong).
Yes, pagella is a extreme case but when you use bold text the vertical spacing is also messed up. You can avoid this when you use a fixed lineheight (e.g. \setupinterlinespace[line=14pt]) because the default distance is font dependant (default: 2.8 * ex-height). or one can play with these parameters, that default to:
\setupinterlinespace [height=.72, depth=.28] (maybe we should have recomended values for specific fonts) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Am 2020-03-16 um 14:35 schrieb Hans Hagen
: Yes, pagella is a extreme case but when you use bold text the vertical spacing is also messed up. You can avoid this when you use a fixed lineheight (e.g. \setupinterlinespace[line=14pt]) because the default distance is font dependant (default: 2.8 * ex-height). or one can play with these parameters, that default to:
\setupinterlinespace [height=.72, depth=.28]
(maybe we should have recomended values for specific fonts)
I had similar problems in the past and got to 2.9ex for Alegreya 3.2ex for Adobe Jenson (Just tried, didn’t calculate anything.) All the best, Hraban
Henning Hraban Ramm schrieb am 16.03.2020 um 15:42:
Am 2020-03-16 um 14:35 schrieb Hans Hagen
: Yes, pagella is a extreme case but when you use bold text the vertical spacing is also messed up. You can avoid this when you use a fixed lineheight (e.g. \setupinterlinespace[line=14pt]) because the default distance is font dependant (default: 2.8 * ex-height). or one can play with these parameters, that default to:
\setupinterlinespace [height=.72, depth=.28]
(maybe we should have recomended values for specific fonts)
I had similar problems in the past and got to 2.9ex for Alegreya 3.2ex for Adobe Jenson
(Just tried, didn’t calculate anything.)
How would this help for the original problem? Wolfgang
On 3/16/2020 6:01 PM, Wolfgang Schuster wrote:
Henning Hraban Ramm schrieb am 16.03.2020 um 15:42:
Am 2020-03-16 um 14:35 schrieb Hans Hagen
: Yes, pagella is a extreme case but when you use bold text the vertical spacing is also messed up. You can avoid this when you use a fixed lineheight (e.g. \setupinterlinespace[line=14pt]) because the default distance is font dependant (default: 2.8 * ex-height). or one can play with these parameters, that default to:
\setupinterlinespace [height=.72, depth=.28]
(maybe we should have recomended values for specific fonts)
I had similar problems in the past and got to 2.9ex for Alegreya 3.2ex for Adobe Jenson
(Just tried, didn’t calculate anything.)
How would this help for the original problem? Some fonts have a different ratio (I forgot what font i did .7 / .3) but indeed an all-bold or whatever style change sometimes demands a local \setupinterlinespace (no argument).
Of course one could also tweak the ht/dp of a specific style using one of the pseudo features. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen schrieb am 16.03.2020 um 18:42:
On 3/16/2020 6:01 PM, Wolfgang Schuster wrote:
Henning Hraban Ramm schrieb am 16.03.2020 um 15:42:
Am 2020-03-16 um 14:35 schrieb Hans Hagen
: Yes, pagella is a extreme case but when you use bold text the vertical spacing is also messed up. You can avoid this when you use a fixed lineheight (e.g. \setupinterlinespace[line=14pt]) because the default distance is font dependant (default: 2.8 * ex-height). or one can play with these parameters, that default to:
\setupinterlinespace [height=.72, depth=.28]
(maybe we should have recomended values for specific fonts)
I had similar problems in the past and got to 2.9ex for Alegreya 3.2ex for Adobe Jenson
(Just tried, didn’t calculate anything.)
How would this help for the original problem? Some fonts have a different ratio (I forgot what font i did .7 / .3) but indeed an all-bold or whatever style change sometimes demands a local \setupinterlinespace (no argument).
I know there are cases where changing the height/depth ration can help but in this case the problem is caused by \strut which is bigger for the italic font. A way to fix the wrong spacing here is to add a strut option to \setuplist (or use always the upright font to set the strut values).
Of course one could also tweak the ht/dp of a specific style using one of the pseudo features.
Also possible because the larger value for the ex-height of the italic font causes the bigger strut dimensions. Wolfgang
On 3/16/20 7:00 PM, Wolfgang Schuster wrote:
[...] A way to fix the wrong spacing here is to add a strut option to \setuplist (or use always the upright font to set the strut values).
Any of these ones would be great to avoid the corner cases. Pablo -- http://www.ousia.tk
participants (4)
-
Hans Hagen
-
Henning Hraban Ramm
-
Pablo Rodriguez
-
Wolfgang Schuster