Tag Archives: measure text

Get font metrics in a WPF program using C#

This example explains how to get font metrics in a WPF application. It’s actually not too hard, it’s just hard to figure out how to do it. The font metrics are tucked away inside the FormattedText object and the Typeface … Continue reading

Posted in drawing, geometry, graphics, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Draw text in random colors in C#

This example shows how you can draw text in random colors. The example Measure character positions in a drawn string in C# shows how to determine where the characters in a string will be drawn. This example uses similar code … Continue reading

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