For some reason if I add a string to GraphicsPath using AddString the font is going to be smaller than it looks like in the Font Dialog.
SizeF sz = g.MeasureString(Text, new Font(Font.FontFamily, (int)(Font.Size - (Font.Size / 7)), Font.Style), new PointF(0, 0), StringFormat.GenericDefault);
this.Size = new Size((int)sz.Width, (int)sz.Height);
//These are not the same
fontpath.AddString(this.Text, this.Font.FontFamily,(int)this.Font.Style, this.Font.Size, new Point(0, 0),StringFormat.GenericDefault);
Does anyone know why it might be doing that?
Assuming your Font.Size's unit is Point, you should convert the size that you passed to AddString to emSize (The height of the em square box that bounds the character).
float emSize = graphics.DpiY * font.Size / 72;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With