At 04:57 29.12.02 -0600, Lars Clausen wrote:
On Sat, 28 Dec 2002, Janne Heikkinen wrote:[...] Another problem I have with CVS version is that fonts are really huge, with following change to lib/font.c I get normal sized fonts: static real global_size_one = 1.0; /* 28.35; */This value is what converts between centimeters (used internally in Dia) and points: 72 pt/in / 2.54 cm/in = 28.35 pt/cm. This might be the same error that Steffan ran into: http://bugzilla.gnome.org/show_bug.cgi?id=99876 Hans also mentioned having to have that as 1.0 or thereabouts. How very confusing.
Nope. The FREETYPE code is using this factor _twice_ which IMO is questionable. The one definition as constant like the comment says is ok, but just using it a second time as in lib/font.c:dia_font_build_layout #ifdef HAVE_FREETYPE height *= global_size_one; #elif defined G_OS_WIN32 height *= 0.7; #endif appears to be wrong. It would be nice to know if changing only the second appearence to 1.0 would solve the 'huge fonts problem'. My current - unverfied - interpretation is as follows: - Pango is expecting its size in points, thus we need to translate from Dia's centimeter to point. See comment about global_size_one. - Pango gives font sizes in pixels (drawn). This size is infuenced by the resolution of the monitor (or what X or GDI thinks it is). There is some code in pango/pango/pangowin32-fontmap.c which does exactly this : fontmap->resolution = PANGO_SCALE / GetDeviceCaps (pango_win32_hdc, LOGPIXELSY) * 72.0; It maybe be possible to get on the correct factor with the attached test program. Or after looking at it's output on my notebook maybe not :-( D:\devel\my-gtk\simples>fontres Screensize is 800x572 pixels 211x158 mm Resolution 96x91 dpi Pixels per cm : 37.9 x 36.2 Dia's magic font factor should be 0.527500(w) or 0.552448(h) The best working factor for win32 is between 0.7 .. 0.71 which could be : - 72 dpi / 96 dpi - 20 / 28.35 - something completely different As Lars says: 'How very confusing' :)
Correct fix is probably to edit some X or pango configuration file but I don't know excatly what file I should edit.That differs from distribution to distribution. Can't help you yet.
Another theory where this second factor comes from would be nice ... Hans
Attachment:
fontres.c
Description: Text document
-------- Hans "at" Breuer "dot" Org ----------- Tell me what you need, and I'll tell you how to get along without it. -- Dilbert