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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user