[NTG-context] grid, interlinespace

Michael Eidenbenz eidenbenz at arch.ethz.ch
Wed Nov 2 11:44:16 CET 2016


Hello

I want my text on a grid and there should be no gap between the top and the capital letters of the first line.
I managed to get this by changing the height parameter of \setupinterlinespace
with a factor I calculated for the font with this formula:

CapHeight/exheight / line = height

CapHeight and exheight are font specific numbers that I got from https://tug.org/TUGboat/tb34-2/tb107sharpe.pdf
for  lmroman this gives me: 683 / 431 / 2.8 = .566 for height in interlinespace

Although there is no gap to the top lines are jumping.
making the factor bigger helps. 
but smaller fonts wont snap to the grid.

What is happening here? 
And is this method of changing the height the right one?

Thanks Michael


------

\showgrid
\setuplayout [grid=yes]
\starttext
\setupinterlinespace
  [
    height=.566,
    line=2.8ex,     
 ]

\setupbodyfont [10pt]
MMMMMMMMMM on grid but jumping\par
\dorecurse{3}{\input tufte \par}
\page

\setupinterlinespace
  [
    height=.575, 
    line=2.8ex,     
 ]

\setupbodyfont [10pt]
MMMMMMMMMM on grid\par
\dorecurse{6}{\input tufte \par}
\page

\setupbodyfont [18pt]
MMMMMMMMMM on grid\par
\dorecurse{2}{\input tufte \par}
\page

\setupbodyfont [7pt]
MMMMMMMMMM on grid\par
\dorecurse{10}{\input tufte\par}
\page

\setupbodyfont [6pt]
MMMMMMMMMM NOT on grid\par
\dorecurse{10}{\input tufte \par}
\page

\setupinterlinespace
  [
    height=.615,     
    line=2.8ex,     
 ]
\setupbodyfont [6pt]
MMMMMMMMMM on grid but gap to top\par
\dorecurse{10}{\input tufte \par}
\page

\setupbodyfont [18pt]
MMMMMMMMMM on grid but gap to top\par
\dorecurse{2}{\input tufte \par}
\page

\stoptext

-----


More information about the ntg-context mailing list