On Mon, 11 Feb 2013, Hans Hagen wrote:
On 2/11/2013 2:18 AM, Aditya Mahajan wrote:
Hi,
While checking my context article for tugboat, Karl Berry found that typewriter fonts were coming out a bit smaller than expected. The following test file shows this:
\starttext {\font\myfont = cmtt9 \myfont externalfigure[logo.pdf][width=1cm]}
{\font\myfont = ec-lmtt9 \myfont externalfigure[logo.pdf][width=1cm]} \stoptext
With ConTeXt MkIV 2013.01.27 (and also with ConTeXt TL), I get the attached output. Notice that the first and second line are of different height.
Both lines are of the same height and width with MkII and with plain TeX.
In context it all depends on how the lineheight (ratio ht/dp) is defined which is:
\setupinterlinespace [height=.72, depth=.28, line=2.8ex]
Also, in the opentype fonts we don't have the limitations of tfm with respect to the number of different heights and depths - in fact, the ht/dp can be derived from either the boundingbox or from the line properties defined in the font.
I don't think that this has anything to do with height/depth radio. The physical size of the glyphs is smaller.
So, as soon as one uses opentype fonts one is also incompatible with respect to spacing (and even with type one there can be differences as one can decide to overload dimensions in the afm -> tfm conversion, although in mkii we always stuck to these automatically generated ones, and not the hand-tweaked ones).
Any ideas on what is happening here? And more specifically, how can I get a typing environment whose font size is the same as that of cmtt9. Using
Maybe tweak the interlinespace related settings as they also dictate the struts (that are often put in front of verbatim lines).
\setuptyping[bodyfont=9pt]
switches to font size that is the same as ec-lmtt9 in the above example.
(I found out that I couldn't test the cmtt9 because I haven't installed these pfb files any longer. I'm surprised that I still did have some cmtt9 tfm file, but that one gets mapped onto an lm counterpart visa the map file.)
FWIW, the size of lmtt10.tfm (or lmmono10-regular.otf) matches that of cmtt9! At least that suggests a workaround. @Karl: Does, \setuptyping[bodyfont=10pt] or \setuptyping[bodyfont=small, style=\tta] give the right size, visually? Aditya