Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font size mismatch between RichTextBox and Word

I have a small WPF application that hosts a RichTextBox:

<RichTextBox SpellCheck.IsEnabled="True" 
             FontFamily="Verdana"
             AcceptsTab="True"
             AcceptsReturn="True"
             FontSize="14" />

As shown the code snippet above, I set the font size to 14. If I copy text from this RichTextBox to Microsoft Word or Microsoft WordPad, the font size is reported to be 10.5. Similar oddities persist if I paste text from Word or WordPad. I have verified that the text being selected from my app is sized at 14. Any help would be greatly appreciated!

like image 868
Joel Avatar asked Aug 19 '09 17:08

Joel


1 Answers

Using FontSize and assigning a simple number means the unit is pixels. Try setting Fontsize="14pt" instead.

Other units: px, in, cm.

like image 134
Joel B Fant Avatar answered Sep 28 '22 08:09

Joel B Fant