Fix local font matching algorithm

We want to check that the name in local() is exactly the same as the local
font, not only included in it.

Fix #2335.
This commit is contained in:
Guillaume Ayoub
2024-12-20 20:01:06 +01:00
parent d8663f11c9
commit 603d87c978
+1 -1
View File
@@ -144,7 +144,7 @@ class FontConfiguration:
for tag in b'fullname', b'postscriptname':
fontconfig.FcPatternGetString(matching_pattern, tag, 0, string)
name = ffi.string(string[0])
if font_name.lower() in name.lower():
if font_name.lower() == name.lower():
fontconfig.FcPatternGetString(
matching_pattern, b'file', 0, string)
path = ffi.string(string[0]).decode(FILESYSTEM_ENCODING)