[PATCH 2/2] gdi32: Append "TrueType" suffix to registry key names

Nikolay Sivov nsivov at codeweavers.com
Sun Aug 14 15:52:16 CDT 2016


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---

For some reason abc8f2c6c270a8f6bce8c5c1f0fc5b5773dad4a9 removed
this logic. Reported as https://bugs.winehq.org/show_bug.cgi?id=34281.

 dlls/gdi32/freetype.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index d989b67..0e82e5e 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -3131,20 +3131,21 @@ static void update_reg_entries(void)
     LIST_FOR_EACH_ENTRY( family, &font_list, Family, entry ) {
         LIST_FOR_EACH_ENTRY( face, &family->faces, Face, entry ) {
             char *buffer;
+            WCHAR *name;
+
             if (!(face->flags & ADDFONT_EXTERNAL_FONT)) continue;
 
-            if(face->FullName)
-            {
-                len = strlenW(face->FullName) + sizeof(TrueType) / sizeof(WCHAR) + 1;
-                valueW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
-                strcpyW(valueW, face->FullName);
-            }
-            else
-            {
-                len = strlenW(family->FamilyName) + sizeof(TrueType) / sizeof(WCHAR) + 1;
-                valueW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
-                strcpyW(valueW, family->FamilyName);
-            }
+            name = face->FullName ? face->FullName : family->FamilyName;
+
+            len = strlenW(name) + 1;
+            if (face->scalable)
+                len += sizeof(TrueType) / sizeof(WCHAR);
+
+            valueW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+            strcpyW(valueW, name);
+
+            if (face->scalable)
+                strcatW(valueW, TrueType);
 
             buffer = strWtoA( CP_UNIXCP, face->file );
             path = wine_get_dos_file_name( buffer );
-- 
2.8.1




More information about the wine-patches mailing list