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
-- v3: win32u: Fix that the replaced font replaces other fonts. win32u: Fix the second_name parsed wrong.
From: Jiajin Cui cuijiajin@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@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
Get font face error when the replaced font is used to replace other fonts.
Signed-off-by: Jiajin Cui cuijiajin@uniontech.com --- dlls/win32u/font.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index e26c7bfa316..f784cf04c80 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -853,7 +853,9 @@ static struct gdi_font_face *find_face_from_full_name( const WCHAR *full_name )
static const struct list *get_family_face_list( const struct gdi_font_family *family ) { - return family->replacement ? &family->replacement->faces : &family->faces; + const struct gdi_font_family *true_family = family->replacement ? family->replacement : family; + while(true_family->replacement) {true_family = true_family->replacement;} + return &true_family->faces; }
static struct gdi_font_face *family_find_face_from_filename( struct gdi_font_family *family, const WCHAR *file_name )
On Wed Aug 17 10:26:37 2022 +0000, Huw Davies wrote:
But should it overwrite a second_name if one has already been found? Note also that this MR has failed the build pipeline.
We should make sure that the second_name in a non-english environment is english name, because some programs set the font name to be an english name, in which case if the family_name and second_name are not english names, the corresponding original font that already exists cannot be found and cause problems with the display of characters. the build pipeline is ok now.
On Thu Aug 18 05:02:38 2022 +0000, Jiajin Cui wrote:
We should make sure that the second_name in a non-english environment is english name, because some programs set the font name to be an english name, in which case if the family_name and second_name are not english names, the corresponding original font that already exists cannot be found and cause problems with the display of characters. The build pipeline is ok now.
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.