ststeiger / PdfSharpCore

Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
Other
1.05k stars 234 forks source link

Font units (em size) is not making sense and doesn't seem right #356

Open SoftCircuits opened 1 year ago

SoftCircuits commented 1 year ago

I don't understand when the documentation specifies the font sizes are specified in "emSize".

According to w3.org, em size represents the font size. And according to Wikipedia, it originally meant the width of the letter 'M'. How can you specify a font size using a unit that is based on the size of a font? This doesn't make sense to me.

And in fact, in practice it seems like the actual value is closer to being interpreted as points. For example, if I specify 14, it looks closer to 14 points than it does to 14 times with the width of the letter 'M'.

Can anyone clarify this? Are font sizes really set in em units? And, if so, what does that mean exactly?