Nikolay Sivov : dwrite: Use helper to trace 4 byte tags.

Alexandre Julliard julliard at winehq.org
Fri Jan 25 16:29:08 CST 2019


Module: wine
Branch: master
Commit: 95a83bc942cee73772a8e74d44931b886d222d8d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=95a83bc942cee73772a8e74d44931b886d222d8d

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Jan 25 14:56:38 2019 +0300

dwrite: Use helper to trace 4 byte tags.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dwrite/analyzer.c       | 15 +++++++--------
 dlls/dwrite/dwrite_private.h |  5 +++++
 dlls/dwrite/font.c           |  5 -----
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c
index c6bcdfa..69e6b11 100644
--- a/dlls/dwrite/analyzer.c
+++ b/dlls/dwrite/analyzer.c
@@ -192,8 +192,7 @@ static const struct dwritescript_properties dwritescripts_properties[Script_Last
 
 const char *debugstr_sa_script(UINT16 script)
 {
-    return script < Script_LastId ? debugstr_an((char*)&dwritescripts_properties[script].props.isoScriptCode, 4):
-            "undefined";
+    return script < Script_LastId ? debugstr_tag(dwritescripts_properties[script].props.isoScriptCode) : "undefined";
 }
 
 /* system font falback configuration */
@@ -1054,7 +1053,7 @@ done:
 
 static UINT32 get_opentype_language(const WCHAR *locale)
 {
-    UINT32 language = DWRITE_FONT_FEATURE_TAG_DEFAULT;
+    UINT32 language = DWRITE_MAKE_OPENTYPE_TAG('d','f','l','t');
 
     if (locale) {
         WCHAR tag[5];
@@ -1145,7 +1144,7 @@ static void analyzer_dump_user_features(DWRITE_TYPOGRAPHIC_FEATURES const **feat
     for (i = 0, start = 0; i < feature_ranges; start += feature_range_lengths[i++]) {
         TRACE("feature range [%u,%u)\n", start, start + feature_range_lengths[i]);
         for (j = 0; j < features[i]->featureCount; j++)
-            TRACE("feature %s, parameter %u\n", debugstr_an((char *)&features[i]->features[j].nameTag, 4),
+            TRACE("feature %s, parameter %u\n", debugstr_tag(features[i]->features[j].nameTag),
                     features[i]->features[j].parameter);
     }
 }
@@ -1836,11 +1835,11 @@ static HRESULT WINAPI dwritetextanalyzer2_GetTypographicFeatures(IDWriteTextAnal
 };
 
 static HRESULT WINAPI dwritetextanalyzer2_CheckTypographicFeature(IDWriteTextAnalyzer2 *iface,
-    IDWriteFontFace *face, DWRITE_SCRIPT_ANALYSIS sa, const WCHAR *localeName,
-    DWRITE_FONT_FEATURE_TAG feature, UINT32 glyph_count, const UINT16 *indices, UINT8 *feature_applies)
+        IDWriteFontFace *face, DWRITE_SCRIPT_ANALYSIS sa, const WCHAR *locale, DWRITE_FONT_FEATURE_TAG feature,
+        UINT32 glyph_count, const UINT16 *glyphs, UINT8 *feature_applies)
 {
-    FIXME("(%p %u %s %x %u %p %p): stub\n", face, sa.script, debugstr_w(localeName), feature, glyph_count, indices,
-        feature_applies);
+    FIXME("(%p %u %s %s %u %p %p): stub\n", face, sa.script, debugstr_w(locale), debugstr_tag(feature), glyph_count,
+            glyphs, feature_applies);
     return E_NOTIMPL;
 }
 
diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h
index a19380a..b8fb250 100644
--- a/dlls/dwrite/dwrite_private.h
+++ b/dlls/dwrite/dwrite_private.h
@@ -76,6 +76,11 @@ static inline const char *debugstr_matrix(const DWRITE_MATRIX *m)
         m->dx, m->dy);
 }
 
+static inline const char *debugstr_tag(DWORD tag)
+{
+    return debugstr_an((char *)&tag, 4);
+}
+
 const char *debugstr_sa_script(UINT16) DECLSPEC_HIDDEN;
 
 static inline unsigned short get_table_entry(const unsigned short *table, WCHAR ch)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 97b99f9..c657eeb 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -320,11 +320,6 @@ static inline struct dwrite_fontfacereference *impl_from_IDWriteFontFaceReferenc
     return CONTAINING_RECORD(iface, struct dwrite_fontfacereference, IDWriteFontFaceReference_iface);
 }
 
-static inline const char *debugstr_tag(UINT32 tag)
-{
-    return debugstr_an((char*)&tag, 4);
-}
-
 static HRESULT get_cached_glyph_metrics(struct dwrite_fontface *fontface, UINT16 glyph, DWRITE_GLYPH_METRICS *metrics)
 {
     static const DWRITE_GLYPH_METRICS nil;




More information about the wine-cvs mailing list