Huw Davies : gdi32: Move some common default fonts to the head of the font list.

Alexandre Julliard julliard at winehq.org
Thu Oct 6 17:24:31 CDT 2011


Module: wine
Branch: master
Commit: 5bd2db4521778e38269218be088d86bf1c441713
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5bd2db4521778e38269218be088d86bf1c441713

Author: Huw Davies <huw at codeweavers.com>
Date:   Thu Oct  6 16:26:08 2011 -0500

gdi32: Move some common default fonts to the head of the font list.

---

 dlls/gdi32/freetype.c |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 24935df..8a687f4 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();




More information about the wine-cvs mailing list