views:

26

answers:

1

Whenever I set a TextBox's FontSize dependency property to a value less than 6.0, whether in XAML or in code, an ArgumentException is thrown. Is there any way to work around this arbitrary limit?

+1  A: 

The limit is a practical one as Pixel fonts are not natively supported and almost all fonts look rubbish at less than 6pt (as they are rendered anti-aliased).

Two options:

  • You can apply scaling to the text object if you insist on going smaller than 6pt,
  • but I would suggest using actual Pixel Fonts for finer work.

Have a look at this answer. "Koistya Navin" has actual code that works a treat rendering his pixel font (code available via links on the question): http://stackoverflow.com/questions/3567671/pixel-fonts-in-silverlight-4

Hope this helps.

Enough already