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. 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 \setuptyping[bodyfont=9pt] switches to font size that is the same as ec-lmtt9 in the above example. Aditya
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. 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.) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Mon, Feb 11, 2013 at 10:21 AM, Hans Hagen wrote:
(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.)
Yes, that has been done on purpose long ago. Most probably because pdfTeX still hardcodes cm fonts to generate the format, or maybe cm fonts have been used somewhere else, I don't remember. I wasn't too keen to ship EC fonts or the proper metafont sources with minimals. Mojca
On 2/11/2013 11:14 AM, Mojca Miklavec wrote:
On Mon, Feb 11, 2013 at 10:21 AM, Hans Hagen wrote:
(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.)
Yes, that has been done on purpose long ago. Most probably because pdfTeX still hardcodes cm fonts to generate the format, or maybe cm fonts have been used somewhere else, I don't remember.
I wasn't too keen to ship EC fonts or the proper metafont sources with minimals.
no need for it as it won't be used unless someone defines his/her own font instances and then one can as well pick up the old stuff from ctan Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
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
participants (3)
-
Aditya Mahajan
-
Hans Hagen
-
Mojca Miklavec