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.
Asked
Active
Viewed 649 times
1
-
4what 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 07 '15 at 00:26
-
For the digits 0 ... 9 I get 25.7 pixels when I should get 30 pixels. – C-M Nov 07 '15 at 00:31
-
1why do you say "should" ? – David Carlisle Nov 07 '15 at 00:38
-
2Your 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 07 '15 at 00: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 07 '15 at 01:14
-
I guess best if you self-answer (and accept), just to finish off the question – David Carlisle Nov 07 '15 at 01:56
2 Answers
1
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
C-M
- 83
-
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 02 '15 at 11:37
0
"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.
vonbrand
- 5,473