Skip to content

Commit

Permalink
Fix local font matching algorithm
Browse files Browse the repository at this point in the history
We want to check that the name in local() is exactly the same as the local
font, not only included in it.

Fix #2335.
  • Loading branch information
liZe committed Dec 20, 2024
1 parent d8663f1 commit 603d87c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weasyprint/text/fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def add_font_face(self, rule_descriptors, url_fetcher):
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)
Expand Down

0 comments on commit 603d87c

Please sign in to comment.