[PATCH 5/5] dwrite: Enable DWRITE_INFORMATIONAL_STRING_WEIGHT_STRETCH_STYLE_FAMILY_NAME for GetInformationalStrings().

Nikolay Sivov nsivov at codeweavers.com
Fri Jan 24 02:17:38 CST 2020


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/dwrite/dwrite_private.h | 2 +-
 dlls/dwrite/font.c           | 9 ++++++---
 dlls/dwrite/opentype.c       | 5 +++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h
index eea3cbabbe..6adba28280 100644
--- a/dlls/dwrite/dwrite_private.h
+++ b/dlls/dwrite/dwrite_private.h
@@ -231,7 +231,7 @@ struct dwrite_fontface
     FONTSIGNATURE fontsig;
     UINT32 glyph_image_formats;
 
-    IDWriteLocalizedStrings *info_strings[DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME+1];
+    IDWriteLocalizedStrings *info_strings[DWRITE_INFORMATIONAL_STRING_WEIGHT_STRETCH_STYLE_FAMILY_NAME + 1];
     IDWriteLocalizedStrings *family_names;
     IDWriteLocalizedStrings *names;
 
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 2732693b4c..8bcbe11fcb 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -82,7 +82,7 @@ struct dwrite_font_data
     struct dwrite_font_propvec propvec;
 
     DWRITE_FONT_METRICS1 metrics;
-    IDWriteLocalizedStrings *info_strings[DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME+1];
+    IDWriteLocalizedStrings *info_strings[DWRITE_INFORMATIONAL_STRING_WEIGHT_STRETCH_STYLE_FAMILY_NAME + 1];
     IDWriteLocalizedStrings *family_names;
     IDWriteLocalizedStrings *names;
 
@@ -1291,8 +1291,11 @@ static HRESULT get_font_info_strings(const struct file_stream_desc *stream_desc,
     *exists = FALSE;
     *ret = NULL;
 
-    if (stringid > DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME || stringid == DWRITE_INFORMATIONAL_STRING_NONE)
+    if (stringid > DWRITE_INFORMATIONAL_STRING_WEIGHT_STRETCH_STYLE_FAMILY_NAME
+            || stringid == DWRITE_INFORMATIONAL_STRING_NONE)
+    {
         return S_OK;
+    }
 
     if (!strings_cache[stringid])
     {
@@ -1301,7 +1304,7 @@ static HRESULT get_font_info_strings(const struct file_stream_desc *stream_desc,
         if (!desc.stream)
             hr = get_filestream_from_file(file, &desc.stream);
         if (SUCCEEDED(hr))
-            hr = opentype_get_font_info_strings(&desc, stringid, &strings_cache[stringid]);
+            opentype_get_font_info_strings(&desc, stringid, &strings_cache[stringid]);
 
         if (!stream_desc->stream && desc.stream)
             IDWriteFontFileStream_Release(desc.stream);
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 1e71ce8614..fd420e4360 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -1098,7 +1098,7 @@ enum OPENTYPE_STRING_ID
     OPENTYPE_STRING_WWS_SUBFAMILY_NAME
 };
 
-static const UINT16 dwriteid_to_opentypeid[DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME+1] =
+static const UINT16 dwriteid_to_opentypeid[DWRITE_INFORMATIONAL_STRING_WEIGHT_STRETCH_STYLE_FAMILY_NAME + 1] =
 {
     (UINT16)-1, /* DWRITE_INFORMATIONAL_STRING_NONE is not used */
     OPENTYPE_STRING_COPYRIGHT_NOTICE,
@@ -1118,7 +1118,8 @@ static const UINT16 dwriteid_to_opentypeid[DWRITE_INFORMATIONAL_STRING_POSTSCRIP
     OPENTYPE_STRING_SAMPLE_TEXT,
     OPENTYPE_STRING_FULL_FONTNAME,
     OPENTYPE_STRING_POSTSCRIPT_FONTNAME,
-    OPENTYPE_STRING_POSTSCRIPT_CID_NAME
+    OPENTYPE_STRING_POSTSCRIPT_CID_NAME,
+    OPENTYPE_STRING_WWS_FAMILY_NAME,
 };
 
 /* CPAL table */
-- 
2.24.1




More information about the wine-devel mailing list