Module: wine Branch: master Commit: ce426d6ad129c34161f618e9a5ebc212c0f9684f URL: http://source.winehq.org/git/wine.git/?a=commit;h=ce426d6ad129c34161f618e9a5...
Author: Paul TBBle Hampson Paul.Hampson@Pobox.com Date: Mon May 4 23:21:27 2009 +1000
gdi32: Don't add system_links entries for substituted fonts.
When a Font is looked up in the FontLinks table, they have already been normalised by FontSubstitutes.
So no need to store system_links entries for fonts that appear as keys in the FontSubstitutes list.
---
dlls/gdi32/freetype.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 2e088b8..7b0afa8 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -1652,9 +1652,15 @@ static BOOL init_system_links(void) while(RegEnumValueW(hkey, index++, value, &val_len, NULL, &type, (LPBYTE)data, &data_len) == ERROR_SUCCESS) { memset(&fs, 0, sizeof(fs)); - font_link = HeapAlloc(GetProcessHeap(), 0, sizeof(*font_link)); psub = get_font_subst(&font_subst_list, value, -1); - font_link->font_name = (psub)? strdupW(psub->to.name) : strdupW(value); + /* Don't store fonts that are only substitutes for other fonts */ + if(psub) + { + TRACE("%s: SystemLink entry for substituted font, ignoring\n", debugstr_w(value)); + continue; + } + font_link = HeapAlloc(GetProcessHeap(), 0, sizeof(*font_link)); + font_link->font_name = strdupW(value); list_init(&font_link->links); for(entry = data; (char*)entry < (char*)data + data_len && *entry != 0; entry = next) {