Question

I have a custom control I have made. It extends a RichTextBox.

I have code that sets the width of the Document so that the number of chars is limited. (I am using Courier New, so I have a fixed width font.)

This all works fine.

But once I put the control in my application, the limit starts failing. After comparing the two, I noted that the spacing between my test application and my real application is different.

Here is an example:

enter image description here

As you can see my spacing for the Test App is larger than the spacing for the Real App.

I don't have any any spacing, kerning, typography or gliph settings (that I can find) in either app. Also, I have checked every setting starting with "Font" (FontSpacing, FontSize...) they are all exactly the same.

What else could cause the text to apply different spacing in one app as opposed to another?

NOTE:

In case it is relevant, the xaml that inserts the control into my test app is the same as the xaml that inserts the control into my real app. I will post it if someone wants to see it.

Was it helpful?

Solution

It probably has to do with the differences between the Ideal and Display TextFormatting Modes. See this SO Question for a good explanation from Hans.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top