Measuring text in WPF

The most low-level technique (and therefore giving the most scope for creative optimisations) is to use GlyphRuns.

It’s not very well documented but I wrote up a little example here:

http://smellegantcode.wordpress.com/2008/07/03/glyphrun-and-so-forth/

The example works out the length of the string as a necessary step before rendering it.

Leave a Comment