patch -- fix resolution in pango (win32 backend)



This patch fixes the resolution calculation in pango
(for the win32 backend).

With the old resolution, when you ask for a font of
size 12, pango used a font of ~7.5 points.

Cheers,

-- 
Joaquín Cuenca Abela
cuenca pacaterie u-psud fr
 Messages Messages Help
Reply | Forward | View Source | Unwrap Lines
 
  Message 2252 of 2252  |  Previous | Next  [ Up Thread ] Message Index
 
 Msg #
From:  Joaquin Cuenca Abela <e98cuenc y   >
Date:  Mon Apr 29, 2002  8:20 am
Subject:  patch -- fix resolution in pango

ADVERTISEMENT
This patch fixes the resolution calculation in pango
(for the win32 backend).

With the old resolution, when you ask for a font of
size 12, pango used a font of ~7.5 points.

Cheers,


=====


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
Index: pango/pangowin32-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangowin32-fontmap.c,v
retrieving revision 1.30
diff -u -r1.30 pangowin32-fontmap.c
--- pango/pangowin32-fontmap.c 1 Jan 2002 23:54:41 -0000 1.30
+++ pango/pangowin32-fontmap.c 28 Apr 2002 20:36:40 -0000
@@ -266,9 +266,7 @@
#endif

SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
- fontmap->resolution =
- (PANGO_SCALE * 72.27 / 25.4) * ((double) GetDeviceCaps (pango_win32_hdc,
HORZSIZE) /
- (rect.right - rect.left));
+ fontmap->resolution = PANGO_SCALE / GetDeviceCaps(pango_win32_hdc,
LOGPIXELSY) * 72.0;

return PANGO_FONT_MAP (fontmap);
}
@@ -911,7 +909,7 @@
/* OK, we have a match; let's modify it to fit this size */

*out = *closest_match;
- out->lfHeight = (int)((double)size / win32fontmap->resolution + 0.5);
+ out->lfHeight = -size / win32fontmap->resolution;
out->lfWidth = 0;
}
else


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