From 2210a8aa8286f7af2e1a17354e9b027a1f669867 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 1 Jan 2002 23:08:39 +0000 Subject: Set lfCharSet to DEFAULT_CHARSET always. Conditional debugging output with 2002-01-02 Tor Lillqvist * pango/pangowin32-fontcache.c (pango_win32_font_cache_load): Set lfCharSet to DEFAULT_CHARSET always. Conditional debugging output with the PING() macro. * pango/pangowin32-fontmap.c: Make the size_infos hash table actually work like it is suppposed to, not that I know if it matters. I think that it's useless to store all the different charset views of the same actual ttf font in the list. Will have to do more testing. (logfont_nosize_hash): Lowercase face name before calculating hash. (logfont_nosize_equal): Compare face names ignoring case. --- ChangeLog | 15 +++++++++++++++ ChangeLog.pre-1-0 | 15 +++++++++++++++ ChangeLog.pre-1-10 | 15 +++++++++++++++ ChangeLog.pre-1-2 | 15 +++++++++++++++ ChangeLog.pre-1-4 | 15 +++++++++++++++ ChangeLog.pre-1-6 | 15 +++++++++++++++ ChangeLog.pre-1-8 | 15 +++++++++++++++ pango/pangowin32-fontcache.c | 34 +++++++++++++++++----------------- pango/pangowin32-fontmap.c | 12 +++++++----- 9 files changed, 129 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0bbc5b1..84a8cdfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2002-01-02 Tor Lillqvist + + * pango/pangowin32-fontcache.c (pango_win32_font_cache_load): Set + lfCharSet to DEFAULT_CHARSET always. Conditional debugging output + with the PING() macro. + + * pango/pangowin32-fontmap.c: Make the size_infos hash table + actually work like it is suppposed to, not that I know if it + matters. I think that it's useless to store all the different + charset vviews of the same actual ttf font in the list. Will have + to do more testing. + (logfont_nosize_hash): Lowercase face name before calculating + hash. + (logfont_nosize_equal): Compare face names ignoring case. + Thu Dec 27 14:19:46 2001 Owen Taylor * modules/basic/basic-x.c: Mark as only an approximate diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0 index f0bbc5b1..84a8cdfb 100644 --- a/ChangeLog.pre-1-0 +++ b/ChangeLog.pre-1-0 @@ -1,3 +1,18 @@ +2002-01-02 Tor Lillqvist + + * pango/pangowin32-fontcache.c (pango_win32_font_cache_load): Set + lfCharSet to DEFAULT_CHARSET always. Conditional debugging output + with the PING() macro. + + * pango/pangowin32-fontmap.c: Make the size_infos hash table + actually work like it is suppposed to, not that I know if it + matters. I think that it's useless to store all the different + charset vviews of the same actual ttf font in the list. Will have + to do more testing. + (logfont_nosize_hash): Lowercase face name before calculating + hash. + (logfont_nosize_equal): Compare face names ignoring case. + Thu Dec 27 14:19:46 2001 Owen Taylor * modules/basic/basic-x.c: Mark as only an approximate diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index f0bbc5b1..84a8cdfb 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,18 @@ +2002-01-02 Tor Lillqvist + + * pango/pangowin32-fontcache.c (pango_win32_font_cache_load): Set + lfCharSet to DEFAULT_CHARSET always. Conditional debugging output + with the PING() macro. + + * pango/pangowin32-fontmap.c: Make the size_infos hash table + actually work like it is suppposed to, not that I know if it + matters. I think that it's useless to store all the different + charset vviews of the same actual ttf font in the list. Will have + to do more testing. + (logfont_nosize_hash): Lowercase face name before calculating + hash. + (logfont_nosize_equal): Compare face names ignoring case. + Thu Dec 27 14:19:46 2001 Owen Taylor * modules/basic/basic-x.c: Mark as only an approximate diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index f0bbc5b1..84a8cdfb 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,18 @@ +2002-01-02 Tor Lillqvist + + * pango/pangowin32-fontcache.c (pango_win32_font_cache_load): Set + lfCharSet to DEFAULT_CHARSET always. Conditional debugging output + with the PING() macro. + + * pango/pangowin32-fontmap.c: Make the size_infos hash table + actually work like it is suppposed to, not that I know if it + matters. I think that it's useless to store all the different + charset vviews of the same actual ttf font in the list. Will have + to do more testing. + (logfont_nosize_hash): Lowercase face name before calculating + hash. + (logfont_nosize_equal): Compare face names ignoring case. + Thu Dec 27 14:19:46 2001 Owen Taylor * modules/basic/basic-x.c: Mark as only an approximate diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index f0bbc5b1..84a8cdfb 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,18 @@ +2002-01-02 Tor Lillqvist + + * pango/pangowin32-fontcache.c (pango_win32_font_cache_load): Set + lfCharSet to DEFAULT_CHARSET always. Conditional debugging output + with the PING() macro. + + * pango/pangowin32-fontmap.c: Make the size_infos hash table + actually work like it is suppposed to, not that I know if it + matters. I think that it's useless to store all the different + charset vviews of the same actual ttf font in the list. Will have + to do more testing. + (logfont_nosize_hash): Lowercase face name before calculating + hash. + (logfont_nosize_equal): Compare face names ignoring case. + Thu Dec 27 14:19:46 2001 Owen Taylor * modules/basic/basic-x.c: Mark as only an approximate diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index f0bbc5b1..84a8cdfb 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,18 @@ +2002-01-02 Tor Lillqvist + + * pango/pangowin32-fontcache.c (pango_win32_font_cache_load): Set + lfCharSet to DEFAULT_CHARSET always. Conditional debugging output + with the PING() macro. + + * pango/pangowin32-fontmap.c: Make the size_infos hash table + actually work like it is suppposed to, not that I know if it + matters. I think that it's useless to store all the different + charset vviews of the same actual ttf font in the list. Will have + to do more testing. + (logfont_nosize_hash): Lowercase face name before calculating + hash. + (logfont_nosize_equal): Compare face names ignoring case. + Thu Dec 27 14:19:46 2001 Owen Taylor * modules/basic/basic-x.c: Mark as only an approximate diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index f0bbc5b1..84a8cdfb 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,18 @@ +2002-01-02 Tor Lillqvist + + * pango/pangowin32-fontcache.c (pango_win32_font_cache_load): Set + lfCharSet to DEFAULT_CHARSET always. Conditional debugging output + with the PING() macro. + + * pango/pangowin32-fontmap.c: Make the size_infos hash table + actually work like it is suppposed to, not that I know if it + matters. I think that it's useless to store all the different + charset vviews of the same actual ttf font in the list. Will have + to do more testing. + (logfont_nosize_hash): Lowercase face name before calculating + hash. + (logfont_nosize_equal): Compare face names ignoring case. + Thu Dec 27 14:19:46 2001 Owen Taylor * modules/basic/basic-x.c: Mark as only an approximate diff --git a/pango/pangowin32-fontcache.c b/pango/pangowin32-fontcache.c index 613c3806..2986a33b 100644 --- a/pango/pangowin32-fontcache.c +++ b/pango/pangowin32-fontcache.c @@ -184,31 +184,31 @@ pango_win32_font_cache_load (PangoWin32FontCache *cache, } else { - BOOL aa = TRUE; /* turn on anti-aliasing */ + BOOL aa; lf = *lfp; SystemParametersInfo (SPI_GETFONTSMOOTHING, 0, &aa, 0); lf.lfQuality = (aa ? ANTIALIASED_QUALITY : DEFAULT_QUALITY); + lf.lfCharSet = DEFAULT_CHARSET; for (tries = 0; ; tries++) { -#if 0 - PANGO_NOTE - (g_print - ("... trying CreateFontIndirect, " - "height=%d,width=%d,escapement=%d,orientation=%d," - "weight=%d,%s%s%s" - "charset=%d,outprecision=%d,clipprecision=%d," - "quality=%d,pitchandfamily=%#.02x,facename=\"%s\")\n", - lf.lfHeight, lf.lfWidth, lf.lfEscapement, lf.lfOrientation, - lf.lfWeight, (lf.lfItalic ? "italic," : ""), - (lf.lfUnderline ? "underline," : ""), - (lf.lfStrikeOut ? "strikeout," : ""), - lf.lfCharSet, lf.lfOutPrecision, lf.lfClipPrecision, - lf.lfQuality, lf.lfPitchAndFamily, lf.lfFaceName)); -#endif + PING (("... trying CreateFontIndirect " + "height=%ld,width=%ld,escapement=%ld,orientation=%ld," + "weight=%ld,%s%s%s" + "charset=%d,outprecision=%d,clipprecision=%d," + "quality=%d,pitchandfamily=%#.02x,facename=\"%s\")", + lf.lfHeight, lf.lfWidth, lf.lfEscapement, lf.lfOrientation, + lf.lfWeight, (lf.lfItalic ? "italic," : ""), + (lf.lfUnderline ? "underline," : ""), + (lf.lfStrikeOut ? "strikeout," : ""), + lf.lfCharSet, lf.lfOutPrecision, lf.lfClipPrecision, + lf.lfQuality, lf.lfPitchAndFamily, lf.lfFaceName)); hfont = CreateFontIndirect (&lf); if (hfont != NULL) - break; + { + PING (("Success!\n")); + break; + } /* If we fail, try some similar fonts often found on Windows. */ if (tries == 0) diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c index 5662d85d..4488f87f 100644 --- a/pango/pangowin32-fontmap.c +++ b/pango/pangowin32-fontmap.c @@ -155,10 +155,12 @@ static guint logfont_nosize_hash (gconstpointer v) { const LOGFONT *lfp = v; + gchar *face = g_ascii_strdown (lfp->lfFaceName, -1); + guint result = g_str_hash (face) + lfp->lfItalic + lfp->lfWeight; - return g_str_hash (lfp->lfFaceName) + - lfp->lfItalic + - lfp->lfWeight; + g_free (face); + + return result; } /* Ditto comparison function */ @@ -168,7 +170,7 @@ logfont_nosize_equal (gconstpointer v1, { const LOGFONT *lfp1 = v1, *lfp2 = v2; - return (strcmp (lfp1->lfFaceName, lfp2->lfFaceName) == 0 + return (g_ascii_strcasecmp (lfp1->lfFaceName, lfp2->lfFaceName) == 0 && lfp1->lfItalic == lfp2->lfItalic && lfp1->lfWeight == lfp2->lfWeight); } @@ -722,7 +724,7 @@ pango_win32_insert_font (PangoWin32FontMap *win32fontmap, PangoStretch stretch; int i; - PING(("lfp.face=%s,wt=%ld,ht=%ld",lfp->lfFaceName,lfp->lfWeight,lfp->lfHeight)); + PING(("lfp.face=%s,charset=%d,it=%d,wt=%ld,ht=%ld",lfp->lfFaceName,lfp->lfCharSet,lfp->lfItalic,lfp->lfWeight,lfp->lfHeight)); /* First insert the LOGFONT into the list of LOGFONTs for the typeface name */ -- cgit v1.2.1