Skip to content

Commit

Permalink
font-patcher: Fix patching woff files
Browse files Browse the repository at this point in the history
[why]
After we added the possibility to process font archives (.ttc) we lost
the ability to process woff and woff2 fonts.

It seems woff(2) files show no font names in fontforge, see
fontforge/fontforge#1964

[how]
Open woff(2) files differently.

Fixes: #1647 (further down)

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Oct 28, 2024
1 parent 9f85498 commit 622de68
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import absolute_import, print_function, unicode_literals

# Change the script version when you edit this script:
script_version = "4.14.4"
script_version = "4.14.5"

version = "3.2.1"
projectName = "Nerd Fonts"
Expand Down Expand Up @@ -2128,8 +2128,11 @@ def main():
sourceFonts = []
all_fonts = fontforge.fontsInFile(args.font)
if not all_fonts:
logger.critical("Can not find any fonts in '%s'", args.font)
sys.exit(1)
if re.match(".*\\.woff2?", args.font, re.I):
all_fonts=[ "" ]
else:
logger.critical("Can not find any fonts in '%s'", args.font)
sys.exit(1)
for i, subfont in enumerate(all_fonts):
if len(all_fonts) > 1:
print("\n")
Expand Down

0 comments on commit 622de68

Please sign in to comment.