[ros-diffs] [khornicek] 44175: - load font substitutes from both SysFontSubstitutes and FontSubstitutes registry keys - add a temporary workaround for font files mapping (compare file name instead of file index) - font selection now works

khornicek at svn.reactos.org khornicek at svn.reactos.org
Sun Nov 15 18:01:45 CET 2009


Author: khornicek
Date: Sun Nov 15 18:01:45 2009
New Revision: 44175

URL: http://svn.reactos.org/svn/reactos?rev=44175&view=rev
Log:
- load font substitutes from  both SysFontSubstitutes and FontSubstitutes registry keys
- add a temporary workaround for font files mapping (compare file name instead of file index)
- font selection now works

Modified:
    branches/arwinss/reactos/dll/win32/gdi32/freetype.c

Modified: branches/arwinss/reactos/dll/win32/gdi32/freetype.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32/freetype.c?rev=44175&r1=44174&r2=44175&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/freetype.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/freetype.c [iso-8859-1] Sun Nov 15 18:01:45 2009
@@ -482,6 +482,7 @@
     void       *data;
     size_t      size;
     HANDLE      file;
+    const char  *filename;     /* HACK see map_font_file */
 };
 
 static struct list mappings_list = LIST_INIT( mappings_list );
@@ -1013,7 +1014,7 @@
     MultiByteToWideChar(CP_ACP, 0, str, -1, nc->name, len);
 }
 
-static void LoadSubstList(void)
+static void LoadSubstList(LPCSTR lpKey)
 {
     FontSubst *psub;
     HKEY hkey;
@@ -1022,8 +1023,8 @@
     LPVOID data;
 
     if(RegOpenKeyA(HKEY_LOCAL_MACHINE,
-		   "Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes",
-		   &hkey) == ERROR_SUCCESS) {
+		   lpKey,
+           &hkey) == ERROR_SUCCESS) {
 
         RegQueryInfoKeyA(hkey, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 			 &valuelen, &datalen, NULL, NULL);
@@ -2937,7 +2938,8 @@
     }
 
     DumpFontList();
-    LoadSubstList();
+    LoadSubstList("Software\\Microsoft\\Windows NT\\CurrentVersion\\SysFontSubstitutes");
+    LoadSubstList("Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes");
     DumpSubstList();
     LoadReplaceList();
     update_reg_entries();
@@ -3004,9 +3006,11 @@
 
     LIST_FOR_EACH_ENTRY( mapping, &mappings_list, struct font_mapping, entry )
     {
-        if (mapping->volumeserial == hfi.dwVolumeSerialNumber &&
-            mapping->indexhigh == hfi.nFileIndexHigh &&
-            mapping->indexlow == hfi.nFileIndexLow )
+/*
+        HACK: check for filename until proper support for GetFileInformationByHandle
+        is implemented in our fs driver
+*/
+        if (!_stricmp(mapping->filename, name))
         {
             mapping->refcount++;
             CloseHandle( file );
@@ -3031,6 +3035,7 @@
     mapping->indexlow = hfi.nFileIndexLow;
     mapping->file = mapped_file;
     mapping->size = hfi.nFileSizeLow;
+    mapping->filename = name;
     list_add_tail( &mappings_list, &mapping->entry );
     return mapping;
 




More information about the Ros-diffs mailing list