Fonts

  • Thread starter Thread starter C# Learner
  • Start date Start date
C

C# Learner

How do I convert a "normal" font size to 'em's?

I'm instantiating a Font object, and it requires the size in 'em's.
 
An EM is a totally subjective measurement based upon the font currently in
use. It comes from the fact that generally, the "M" is the widest character
in the font and so a column width of so-many Ems would be different with
various typefaces.

The em square is a square that should encompass each glyph in a font but
doesn't *have* to. For example the lower case "f" in some fonts has a
decender that extends past the bottom of the em square.

Font sizes will generally be specified in pixels or, more commonly, points.
A point is roughly 1:72nd of an inch. To calculate the font size in pixels
you have to know the screen or printer DPI

When a True Type font is designed it will have an em square of a specific
dimension, These units are only there to subdivide the font and have nothing
to do with real-world measurements. A font may be constructed with an
em-square of 1000 or 1080 or 2048 or any other large-ish number. When the
font is rendered these "font units" are used to create a bitmap version of
the font and invariably have no ratiometric relationship to the final size
of the displayed font.

Now, Explain exactly what you're trying to do...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Check out February's edition of Well Formed.
Non-client drawing, Graphics Transform stack and Flood-Filling
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com
 
Bob said:
An EM is a totally subjective measurement based upon the font currently in
use. It comes from the fact that generally, the "M" is the widest character
in the font and so a column width of so-many Ems would be different with
various typefaces.
[...]

Hi Bob,

Thanks for the reply. In fact, my problem wasn't caused by the "em"
thing. It was a logical error in my code. Doh!
 
Back
Top