[PATCH 5/7] gdi32: Trace full name instead of family + style.

Rémi Bernon rbernon at codeweavers.com
Fri Sep 4 13:07:18 CDT 2020


The gdi32 family not always matches the real font family, as we match
only LF_FACESIZE chars, so it can make traces confusing.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/gdi32/freetype.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index fad7143dd58..f9b989d9e90 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -1572,10 +1572,7 @@ static inline int style_order(const Face *face)
     case NTM_BOLD | NTM_ITALIC:
         return 3;
     default:
-        WARN("Don't know how to order font %s %s with flags 0x%08x\n",
-             debugstr_w(face->family->FamilyName),
-             debugstr_w(face->StyleName),
-             face->ntmFlags);
+        WARN( "Don't know how to order face %s with flags 0x%08x\n", debugstr_w(face->full_name), face->ntmFlags );
         return 9999;
     }
 }
@@ -1588,9 +1585,9 @@ static BOOL insert_face_in_family_list( Face *face, Family *family )
     {
         if (faces_equal( face, cursor ))
         {
-            TRACE("Already loaded font %s %s original version is %lx, this version is %lx\n",
-                  debugstr_w(family->FamilyName), debugstr_w(face->StyleName),
-                  cursor->font_version, face->font_version);
+            TRACE( "Already loaded face %s in family %s, original version %lx, new version %lx\n",
+                   debugstr_w(face->full_name), debugstr_w(family->FamilyName),
+                   cursor->font_version, face->font_version );
 
             if (face->file && face->dev == cursor->dev && face->ino == cursor->ino)
             {
@@ -1621,7 +1618,8 @@ static BOOL insert_face_in_family_list( Face *face, Family *family )
         if (style_order( face ) < style_order( cursor )) break;
     }
 
-    TRACE("Adding new %s\n", debugstr_w(face->file));
+    TRACE( "Adding face %s in family %s from %s\n", debugstr_w(face->full_name),
+           debugstr_w(family->FamilyName), debugstr_w(face->file) );
     list_add_before( &cursor->entry, &face->entry );
     face->family = family;
     family->refcount++;
@@ -1742,7 +1740,7 @@ static void load_face(HKEY hkey_face, WCHAR *face_name, Family *family, void *bu
               face->fs.fsUsb[2], face->fs.fsUsb[3]);
 
         if (insert_face_in_family_list(face, family))
-            TRACE("Added font %s %s\n", debugstr_w(family->FamilyName), debugstr_w(face->StyleName));
+            TRACE( "Added face %s to family %s\n", debugstr_w(face->full_name), debugstr_w(family->FamilyName) );
 
         release_face( face );
     }
@@ -2193,9 +2191,7 @@ static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr
     {
         if (flags & ADDFONT_ADD_TO_CACHE)
             add_face_to_cache( face );
-
-        TRACE("Added font %s %s\n", debugstr_w(family->FamilyName),
-              debugstr_w(face->StyleName));
+        TRACE( "Added face %s to family %s\n", debugstr_w(face->full_name), debugstr_w(family->FamilyName) );
     }
     release_face( face );
     release_family( family );
@@ -2389,7 +2385,8 @@ static void DumpFontList(void)
     LIST_FOR_EACH_ENTRY( family, &font_list, Family, entry ) {
         TRACE("Family: %s\n", debugstr_w(family->FamilyName));
         LIST_FOR_EACH_ENTRY( face, &family->faces, Face, entry ) {
-            TRACE("\t%s\t%08x", debugstr_w(face->StyleName), face->fs.fsCsb[0]);
+            TRACE( "\t%s\t%s\t%08x", debugstr_w(face->StyleName), debugstr_w(face->full_name),
+                   face->fs.fsCsb[0] );
             if(!face->scalable)
                 TRACE(" %d", face->size.height);
             TRACE("\n");
@@ -5906,8 +5903,8 @@ found_face:
     else
         ret->charset = get_nearest_charset(family->FamilyName, face, &ret->codepage);
 
-    TRACE("Chosen: %s %s (%s/%p:%ld)\n", debugstr_w(family->FamilyName),
-	  debugstr_w(face->StyleName), debugstr_w(face->file), face->font_data_ptr, face->face_index);
+    TRACE( "Chosen: %s (%s/%p:%ld)\n", debugstr_w(face->full_name), debugstr_w(face->file),
+           face->font_data_ptr, face->face_index );
 
     ret->aveWidth = height ? lf.lfWidth : 0;
 
-- 
2.28.0




More information about the wine-devel mailing list