开发者

WPF Windows program displays in large fonts but only on one PC

I have a WPF application rendering fonts to a larger size than I expect.

The catch is that only WPF applications I write seem to have this effect, and the problem happens only on one computer. The effect also happens with all WPF programs I write (not just one), and all windows exhit the effect.

I am using Visual Studio 2008 with .NET 3.5 SP1; all programs written in WPF.

The operatin开发者_JAVA技巧g system is Windows XP with the latest service packs.

The screen resolution is 1680x1050.

Windows and buttons using Windows XP style.

Font size is Normal.

DPI setting is normal size (96 dpi).

I tested my applications on a two other computers with same OS and settings and it looks fine. My programs run on dozens of other computers and I do not see this problem.

Here is a window that looks good:

WPF Windows program displays in large fonts but only on one PC

Here is a window that shows the problem (notice the button on the lower left, and the font size):

WPF Windows program displays in large fonts but only on one PC

I know I can increase the width and add margin to compensate, but I need to understand why this happening. I am close to a release and I want to make sure my users do not see this effect.

All ideas appreciated.


I'm not running XP right now, but I thought you could customize the size of the text that appears in window captions (and buttons) via the Display Properties (right-click desktop, select Properties, and it's the 3rd or 4th tab, I think). It lets you select colors for selected items, background colors of windows, etc.

That would be separate from setting the DPI settings.


This looks like an unholy XP feature. It had the option to change the size of the system font independently from the video adapter DPI setting. Very convenient to XP users living in Easy Asia where glyphs that make up the letters are very intricate and need all the pixels they can get to make their script legible.

It is covered by Windows Forms with the Form.AutoScaleMode property, which defaults to Font instead of Dpi. WPF is however strongly biased to Dpi, the normal way of scaling.

I don't think the twain shalt ever meet. Tell your user to reset the XP setting. It is buried somewhere in the Control Panel + Display setting, I don't have it anymore to tell you exactly where to look. Or the logical alternative, changing the video DPI setting to match the font size. That's was in the Adapter tab, IIRC. Changing it from 96 to 120 DPI would be a good guess.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜