I need this information because I would like to use the Computer Modern fonts in a Windows application that I am developing. The GUI library that I am using (wxWidgets) requires that all lengths be specified in pixels.

  • 4
    what number do you get and what number do you expect? Note the "size of font" such as "10pt" is only a name it does not necessarily relate to any measurement of any visible aspect of the font. – David Carlisle Nov 7 '15 at 0:26
  • For the digits 0 ... 9 I get 25.7 pixels when I should get 30 pixels. – C-M Nov 7 '15 at 0:31
  • 1
    why do you say "should" ? – David Carlisle Nov 7 '15 at 0:38
  • 2
    Your question would be a lot clearer if it contained a complete small document with some digits in it and you asked about the size of those digits then people can trace the details. As it is it's just too vague to answer. – David Carlisle Nov 7 '15 at 0:40
  • I'm sorry: I should have mentioned that I am actually trying to use the Computer Modern fonts in a Windows application that I am developing. I was having problems aligning some symbols with the baseline. Thanks to your comment I realized that I need some additional metric information (called the ascent and provided by Windows) in order to obtain a correct alignment. – C-M Nov 7 '15 at 1:14

According to the documentation of TFtoPL (see Section 10, p. 205), 7227 TeX points correspond to 100 inches (254 cm). To convert inches into pixels, one must know the resolution (in ppi = pixels per inch) of the rendering device (e.g., a monitor or a printer).

The final formula is:

[Size in pixels] = [Size in TeX points] * [Device resolution in ppi] / 72.27

  • Note that for some display devices, the horizontal and vertical ppi ratios differ. So you may need to use different formulas for measuring horizontal and vertical distances, or something even more complicated for curves or diagonal lines. – Psychonaut Dec 2 '15 at 11:37

"TeX points" are an absolute length measure, "pixels" depend on the display resolution. The same document can be displayed on varying screens, and even at different magnifications. Or be printed on a inkjet printer, a high-end laser printer, or a professional typesetter. Wildly different pixel sizes.

  • I replaced "screen" by "device" in the formula. – C-M Nov 7 '15 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.