Archive

Posts Tagged ‘ExpressionDesign’

Font Size Tip for Silverlight

February 27th, 2009

I often forget that font size is pixel-based instead of point-based when working with Silverlight. Designers using Expression Design will set the point size for Text fonts because that’s what available to them.

image

When implementing a design that was created using Expression Design, I need to convert the point values for fonts to pixel values for the fonts to be rendered accurately as designed. Traditionally, a point is 1/72 of an inch. A Silverlight pixel renders at 1/96 of an inch. To convert a point to a pixel, I need to multiply the point by 96/72 or 1.333….

Here’s a handy chart that I use.

Point (pt) Pixel (px)~
7pt 9.333
8pt 10.666
9pt 12
10pt 13.333
11pt 14.666
12pt 16
13pt 17.333
14pt 18.666
15pt 20

image

Note that this is not an issue with setting FontSize for TextBlocks in WPF. With WPF, the FontSize value can be set with the “pt” unit qualifier and no conversion is necessary. Unit qualifiers are not supported in Silverlight 2.

Design , ,