From 5bd2db4521778e38269218be088d86bf1c441713 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Thu, 6 Oct 2011 16:26:08 -0500 Subject: [PATCH] gdi32: Move some common default fonts to the head of the font list. --- dlls/gdi32/freetype.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 24935dfd88f..8a687f40823 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3154,6 +3154,40 @@ static void init_font_list(void) } } +static BOOL move_to_front(const WCHAR *name) +{ + Family *family, *cursor2; + LIST_FOR_EACH_ENTRY_SAFE(family, cursor2, &font_list, Family, entry) + { + if(!strcmpiW(family->FamilyName, name)) + { + list_remove(&family->entry); + list_add_head(&font_list, &family->entry); + return TRUE; + } + } + return FALSE; +} + +static const WCHAR arial[] = {'A','r','i','a','l',0}; +static const WCHAR bitstream_vera_sans[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','a','n','s',0}; +static const WCHAR bitstream_vera_sans_mono[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','a','n','s',' ','M','o','n','o',0}; +static const WCHAR bitstream_vera_serif[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','e','r','i','f',0}; +static const WCHAR courier_new[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}; +static const WCHAR times_new_roman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0}; + +static void reorder_font_list(void) +{ + if(!move_to_front(times_new_roman)) + move_to_front(bitstream_vera_serif); + + if(!move_to_front(courier_new)) + move_to_front(bitstream_vera_sans_mono); + + if(!move_to_front(arial)) + move_to_front(bitstream_vera_sans); +} + /************************************************************* * WineEngInit * @@ -3186,6 +3220,8 @@ BOOL WineEngInit(void) RegCloseKey(hkey_font_cache); + reorder_font_list(); + DumpFontList(); LoadSubstList(); DumpSubstList();