[PATCH v6 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> -- v6: win32u: Make the replacement font not the replaced font. https://gitlab.winehq.org/wine/wine/-/merge_requests/628
From: Jiajin Cui <cuijiajin(a)uniontech.com> 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> --- 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> If we're going to allow replacements of replacements,get_family_face_list will be error. Signed-off-by: Jiajin Cui <cuijiajin(a)uniontech.com> --- dlls/win32u/font.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index e26c7bfa316..9f24fe716df 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) + { + WARN( "%s is replaced by another font!\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
On Thu Aug 18 08:38:12 2022 +0000, Huw Davies wrote:
I see thanks, in which case the first commit looks ok. However, in the second commit, if we're going to allow replacements of replacements, we'd have to guard against an infinite loop. I agree with you that it is better to amend it to not allow replacements of replacements.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/628#note_6512
participants (2)
-
Jiajin Cui -
Jiajin Cui (@jin-king1)