dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [PATCH] Font size problem


From: Marc Haisenko
Subject: [Pnet-developers] [PATCH] Font size problem
Date: Mon, 6 Dec 2004 15:24:40 +0100
User-agent: KMail/1.7.1

Hi folks,
I'm currently investigating some dotGNU problems that the Trumpf project 
faces. My current target is the problem that the font sizes don't match under 
Windows and X Window.

I've written a small test application with a label and a textbox where I can 
choose the size of the text in the label. I then measured the size of the I 
(uppercase i) under Windows using rdesktop and the experimented with the 
dotGNU code. The goal is that the font size in pixels should be equal on both 
Windows and X Window for a given font size in points.

After a few experiments it turns our that setting the const float 
PointSizeConversion in System.Drawing.Xsharp.DrawingFont to 96.0 gives me the 
closest match to the Windows size (an exact match for sizes 10, 50 and 100). 
I've tested this with my desktop system (1024x768, Xsharp reports 80.94 DPI) 
and with a VMWare (800x600, Xsharp reports 75.07 DPI).

Indeed, after googling around a bit it turns out that Windows really normally 
assumes a resolution of 96 DPI for font rendering or 120 DPI when setting the 
font set to large, not the 108 DPI to which PointSizeConversion is currently 
set.

So I'd like to have the const float PointSizeConversion in DrawingFont.cs 
changed to 96.0f (patch is attached) to fix the font sizes on X Window.

Also attached is a patch to allow bigger font sizes... Xsharp.Font currently 
limits the maximum font size to be 1000 pt high. But this is the internal 
size, which equals to a maximum "real" font size of about 84 pt (when 
PointSizeConversion is set to 96). There's no reason to not allow bigger 
fonts, IMHO.

C'ya,
        Marc

-- 
Marc Haisenko
Systemspezialist
Webport IT-Services GmbH
mailto: address@hidden

Attachment: DrawingFont.patch
Description: Text Data

Attachment: Font.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]