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?
views:
26answers:
1
+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
2010-09-07 19:10:41