From b503a3dc1d8d61867aba17fa8d6aecadee32b7d8 Mon Sep 17 00:00:00 2001 From: Idriss Fekir Date: Tue, 24 Oct 2023 23:56:36 +0100 Subject: [PATCH] Fix bug when font is from a .ttc file When loading an xcf file, if a a font has already been used, its file's hash is compared against the hashes from the xcf file (to speedup loading), but if the font is from a .ttc file (a font collection), then all fonts from that file will have the same file hash, so the wrong font might be selected. a simple solution is to not use the hash except as a last resort if every other field is identical. --- app/text/gimpfont.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/text/gimpfont.c b/app/text/gimpfont.c index 909c912c09..d6ad9f6bec 100644 --- a/app/text/gimpfont.c +++ b/app/text/gimpfont.c @@ -402,13 +402,6 @@ gimp_font_deserialize_create (GType type, font = GIMP_FONT (gimp_container_get_child_by_index (fonts_container, i)); - if (fonthash != NULL && font->hash != NULL && !g_strcmp0 (font->hash, fonthash)) - { - most_similar_font_index = i; - g_clear_pointer (&similar_fonts, g_list_free); - break; - } - /* Some attrs are more identifying than others, * hence their higher importance in measuring similarity. */