Lei Zhang : gdi32: Check for regular fonts by style instead of style name.
Alexandre Julliard
julliard at winehq.org
Sat Jun 21 05:39:17 CDT 2008
Module: wine
Branch: master
Commit: 71ed7573aaa532eecae32a90136a4e0cb67a599a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=71ed7573aaa532eecae32a90136a4e0cb67a599a
Author: Lei Zhang <thestig at google.com>
Date: Thu Jun 19 14:57:46 2008 -0700
gdi32: Check for regular fonts by style instead of style name.
---
dlls/gdi32/freetype.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 8bcb487..359eb6d 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -360,8 +360,6 @@ static const WCHAR defSerif[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o'
static const WCHAR defSans[] = {'A','r','i','a','l','\0'};
static const WCHAR defFixed[] = {'C','o','u','r','i','e','r',' ','N','e','w','\0'};
-static const WCHAR RegularW[] = {'R','e','g','u','l','a','r','\0'};
-
static const WCHAR fontsW[] = {'\\','f','o','n','t','s','\0'};
static const WCHAR win9x_font_reg_key[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s','\\',
@@ -1945,7 +1943,7 @@ static void update_reg_entries(void)
face = LIST_ENTRY(face_elem_ptr, Face, entry);
if(!face->external) continue;
len = len_fam;
- if(strcmpiW(face->StyleName, RegularW))
+ if (!(face->ntmFlags & NTM_REGULAR))
len = len_fam + strlenW(face->StyleName) + 1;
valueW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
strcpyW(valueW, family->FamilyName);
@@ -4849,7 +4847,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
needed += lenfam;
/* length of otmpFaceName */
- if(!strcasecmp(ft_face->style_name, "regular")) {
+ if ((ft_face->style_flags & (FT_STYLE_FLAG_ITALIC | FT_STYLE_FLAG_BOLD)) == 0) {
needed += lenfam; /* just the family name */
} else {
needed += lenfam + lensty; /* family + " " + style */
@@ -5047,7 +5045,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
cp += lensty;
font->potm->otmpFaceName = (LPSTR)(cp - (char*)font->potm);
strcpyW((WCHAR*)cp, family_nameW);
- if(strcasecmp(ft_face->style_name, "regular")) {
+ if (ft_face->style_flags & (FT_STYLE_FLAG_ITALIC | FT_STYLE_FLAG_BOLD)) {
strcatW((WCHAR*)cp, spaceW);
strcatW((WCHAR*)cp, style_nameW);
cp += lenfam + lensty;
More information about the wine-cvs
mailing list