[PATCH v7 0/2] MR628: win32u: Fix the second_name parsed wrong.
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(a)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. https://gitlab.winehq.org/wine/wine/-/merge_requests/628
From: Jiajin Cui <cuijiajin(a)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; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/628
From: Jiajin Cui <cuijiajin(a)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++; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/628
I've pushed a new version (mainly with changes to the commit messages). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/628#note_6542
This merge request was approved by Huw Davies. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/628
participants (3)
-
Huw Davies (@huw) -
Jiajin Cui -
Jiajin Cui (@jin-king1)