[WIN32SS][NTGDI] Keep FontSubstitutes enumeration CORE-15785 (#1532)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Fri, 26 Apr 2019 12:56:36 +0000 (21:56 +0900)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2019 12:56:36 +0000 (21:56 +0900)
Fix CORE-15785. When LOGFONT.lfFaceName[0] == 0, then enumeration of font substitutes had failed. CORE-15785

win32ss/gdi/ntgdi/freetype.c

index a613a9f..ae6feb0 100644 (file)
@@ -2821,7 +2821,13 @@ GetFontFamilyInfoForSubstitutes(const LOGFONTW *LogFont,
         GetFontFamilyInfoForList(&lf, Info, pFromW->Buffer, pCount, MaxCount,
                                  &Win32Process->PrivateFontListHead);
         IntUnLockProcessPrivateFonts(Win32Process);
-        break;
+
+        if (LogFont->lfFaceName[0])
+        {
+            /* it's already matched to the exact name and charset if the name
+               was specified at here, then so don't scan more for another name */
+            break;
+        }
     }
 
     return TRUE;