When first parsed to names in english and other non-native languages, after parsing to names in native languages, this will result in second_name not corresponding to names in english.
Signed-off-by: Jiajin Cui cuijiajin@uniontech.com
-- v7: win32u: Don't allow a replaced font to be a replacement. win32u: Ensure that either the primary or secondary name is in English.
From: Jiajin Cui cuijiajin@uniontech.com
--- dlls/win32u/freetype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index f00df7ed86d..f6cdddd7819 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -1100,7 +1100,7 @@ static BOOL search_family_names_callback( LANGID langid, struct opentype_name *n else if (data->primary_langid == langid) { data->primary_seen = TRUE; - if (!data->second_name.bytes) data->second_name = data->family_name; + if (data->family_name.bytes) data->second_name = data->family_name; data->family_name = *name; } else if (!data->second_name.bytes) data->second_name = *name;
From: Jiajin Cui cuijiajin@uniontech.com
This is to prevent replacement loops. --- dlls/win32u/font.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index e26c7bfa316..e281db9b0c8 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -903,6 +903,12 @@ static BOOL add_family_replacement( const WCHAR *new_name, const WCHAR *replace return FALSE; }
+ if (family->replacement) + { + TRACE( "%s is replaced by another font, skipping.\n", debugstr_w(replace) ); + return FALSE; + } + if (!(new_family = create_family( new_name, NULL ))) return FALSE; new_family->replacement = family; family->refcount++;
I've pushed a new version (mainly with changes to the commit messages).
This merge request was approved by Huw Davies.