summaryrefslogtreecommitdiff
path: root/pango/pangowin32-fontmap.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2002-05-26 00:19:10 +0000
committerTor Lillqvist <tml@src.gnome.org>2002-05-26 00:19:10 +0000
commit25878a0341a8076296ab4ae88ee972641e6f963c (patch)
tree6b65ac21b13ca2948c94a2504efc88e9160e5c12 /pango/pangowin32-fontmap.c
parent2ae219a829b3b2c77f27b93cc4b03a2ddde23fd5 (diff)
downloadpango-25878a0341a8076296ab4ae88ee972641e6f963c.tar.gz
Use complete PANGO_VERSION in zip file names.
2002-05-26 Tor Lillqvist <tml@iki.fi> * pango-zip.sh.in: Use complete PANGO_VERSION in zip file names. * pango/Makefile.am: (Win32) Compile resource files and link with them. * pango/pango.rc.in * pango/pangoft2.rc.in * pango/pangowin32.rc.in: Include also the micro version number. * pango/pangowin32-fontcache.c (logfont_hash): Use absolute value of lfHeight. * pango/pangowin32-fontmap.c (pango_win32_font_map_for_display): Instead of HORZSIZE which is Windows idea of physical monitor width (but which can be *very* wrong), use LOGPIXELSY (the "logical" dpi). This can be set by the user by choosing "small fonts", "large fonts", or a custom dpi in the Display Settings. Thanks to Joaquin Cuenca Abela. (pango_win32_make_matching_logfont): Set lfHeight to the negative of the requested size. Positive lfHeight indicates "cell height", negative "character height" (?), which is closer to what we want, says Joaquin Cuenca Abela.
Diffstat (limited to 'pango/pangowin32-fontmap.c')
-rw-r--r--pango/pangowin32-fontmap.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c
index 31a945d6..01227d04 100644
--- a/pango/pangowin32-fontmap.c
+++ b/pango/pangowin32-fontmap.c
@@ -244,7 +244,6 @@ PangoFontMap *
pango_win32_font_map_for_display (void)
{
LOGFONT logfont;
- RECT rect;
/* Make sure that the type system is initialized */
g_type_init ();
@@ -265,10 +264,7 @@ pango_win32_font_map_for_display (void)
pango_win32_font_map_read_aliases (fontmap);
#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);
}
@@ -888,7 +884,7 @@ pango_win32_make_matching_logfont (PangoFontMap *fontmap,
while (tmp_list)
{
LOGFONT *tmp_logfont = tmp_list->data;
- int font_size = tmp_logfont->lfHeight;
+ int font_size = abs (tmp_logfont->lfHeight);
if (size != -1)
{
@@ -911,7 +907,7 @@ pango_win32_make_matching_logfont (PangoFontMap *fontmap,
/* 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 = -(int)((double)size / win32fontmap->resolution + 0.5);
out->lfWidth = 0;
}
else