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.
This commit is contained in:
Idriss Fekir 2023-10-24 23:56:36 +01:00 committed by Jehan
parent 28e94a6d8f
commit b503a3dc1d
1 changed files with 0 additions and 7 deletions

View File

@ -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.
*/