Tag Archives: font size

Get font size in pixels in C#

One oddity of the Font class is that its Size property returns font size in the units that were used to create the font. The Font class’s Unit property tells you the units used to create the font, but if … Continue reading

Posted in drawing, fonts, graphics | Tagged , , , , , , , , , , , , , , | Leave a comment

Set font size to fit a wrapped label in C#

The example Set font size to fit a label in C# shows how you can pick a font size to make text large but still fit inside a Label. This example is similar except it allows the text to wrap … Continue reading

Posted in drawing, fonts, graphics | Tagged , , , , , , , , , , , , , , | Leave a comment

Set font size to fit a label in C#

This program uses the following method to calculate the largest font size that the Label can use while still allowing the sample text to fit. // Return the largest font size that lets the text fit. private float GetFontSize(Label label, … Continue reading

Posted in drawing, fonts, graphics | Tagged , , , , , , , , , , , , | Leave a comment

Size a font to fit a Label in C#

The following SizeLabelFont method shows how to size a font to fit a Label‘s text. It gives a Label the biggest font possible while still allowing its text to fit. // Copy this text into the Label using // the … Continue reading

Posted in fonts, graphics | Tagged , , , , , , , , , , | 2 Comments