Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cambria Math big top and bottom margin

Tags:

c#

winforms

fonts

I wanted to show some mathematical expressions in a winforms textbox. So I thought the "Cambria Math" font would be a good choice but the text looked strange due the high top and bottom margin of the font. First I thought I made a mistake but according to this question, it's the correct behavior of the font.

Screenshot of the textbox

Why does Cambria Math have these big margin values and how can I display my string correctly in the textbox like Word 2010?

(Note that I know only a little bit about typography ;)

Edit: I had to make the textbox that tall otherwise the caret would be invisible. The font size of the textbox is set to 8.25pt

like image 691
MBulli Avatar asked Dec 24 '11 11:12

MBulli


1 Answers

Cambria Math uses Microsoft's mathematical OpenType extensions.

Word 2007 and later understand these and display the text with reasonable spacing.

However, notepad and Word 2000 display the text with enormous spacing, just like winforms. I guess the font has this much space by default because some characters (like U+2320, top half integral) are much larger than the alphanumerics.

If you use Cambria Math with a font engine (such as the one used by winforms) that doesn't understand the math extensions, you're going to get the big spacing.

If you're displaying simple expressions you might as well use Cambria.

like image 68
arx Avatar answered Oct 12 '22 13:10

arx