From 5232745f652495ec1ab73fcb7368fe858cc0099c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 18 Jul 2000 06:06:41 +0000 Subject: Add the pangowin32 sources. 2000-07-18 Tor Lillqvist * pango/Makefile.am (EXTRA_DIST): Add the pangowin32 sources. * pango/pangox.c (lang_texts): Add some Latin-1 to the Finnish and Swedish strings. * modules/module.def: New file. * modules/Makefile.am (EXTRA_DIST): Add it. * modules/basic/Makefile.am (EXTRA_DIST): Add basic-win32.c. * */makefile.mingw: Small updates. * pango/pangowin32.c * pango/pangowin32-fontmap.c * modules/basic/basic-win32.c * examples/viewer-win32.c: Bug fixes. Remove dead code. Now the Win32 implementation seems to work, except for a few glitches. --- pango/pangowin32-fontmap.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'pango/pangowin32-fontmap.c') diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c index a7b6cde4..85298885 100644 --- a/pango/pangowin32-fontmap.c +++ b/pango/pangowin32-fontmap.c @@ -235,6 +235,7 @@ PangoFontMap * pango_win32_font_map_for_display (void) { LOGFONT logfont; + RECT rect; /* Make sure that the type system is initialized */ g_type_init(); @@ -253,7 +254,10 @@ pango_win32_font_map_for_display (void) pango_win32_font_map_read_aliases (fontmap); - fontmap->resolution = 0; /* ??? */ + SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0); + fontmap->resolution = + (PANGO_SCALE * 72.27 / 25.4) * ((double) GetDeviceCaps (pango_win32_hdc, HORZSIZE) / + (rect.right - rect.left)); return PANGO_FONT_MAP (fontmap); } @@ -1056,6 +1060,8 @@ pango_win32_font_map_read_alias_file (PangoWin32FontMap *win32fontmap, else font_entry->lfp[i].lfWeight = FW_HEAVY; + font_entry->lfp[i].lfQuality = ANTIALIASED_QUALITY; + /* Stretch ? */ /* Charset is ignored anyway when used with the widechar @@ -1324,7 +1330,9 @@ pango_win32_make_matching_logfont (PangoFontMap *fontmap, /* OK, we have a match; let's modify it to fit this size */ result = g_new (LOGFONT, 1); + *result = *closest_match; result->lfHeight = (int)((double)size / win32fontmap->resolution + 0.5); + result->lfWidth = 0; } return result; -- cgit v1.2.1