Skip to content

Commit

Permalink
Adapt to Nerd Fonts 3.2.1
Browse files Browse the repository at this point in the history
[why]
Some internals of the font-patcher changed since 2.3.3, that we use
directly.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed May 2, 2024
1 parent 9837d7a commit afd3e45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Install configparser
run: pip3 install configparser
- name: Extract additional powerline glyphs
run: fontforge -lang=ff -script "`pwd`/extract-extra-glyphs" "`pwd`" `pwd`/src/**/octicons.ttf
run: fontforge -lang=ff -script "`pwd`/extract-extra-glyphs" "`pwd`" `pwd`/src/glyphs/octicons/octicons.ttf
- name: Build Powerline
run: |
./do_generate 01 --powerline --mono CascadiaCodePL-Regular.ttf DelugiaPL.ttf "Delugia PL"
Expand Down
8 changes: 5 additions & 3 deletions rename-font
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import os.path
import fontforge
import sys, logging
from argparse import ArgumentParser

sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0])) + '/bin/scripts/name_parser/')
Expand All @@ -23,7 +24,8 @@ SIL_TABLE = [('cascadia ?(code|mono)( ?pl)?', args.name), ]
print("\nRenaming process\n {}\n as {}\n -> {}".format(args.input, args.orig, args.output))

fname = os.path.splitext(os.path.basename(args.orig))[0]
n = FontnameParser(fname)
logger = logging.getLogger()
n = FontnameParser(fname, logger)
n.add_name_substitution_table(SIL_TABLE)
n.set_keep_regular_in_family(False)
if not n.parse_ok:
Expand All @@ -36,15 +38,15 @@ delugia=fontforge.open(args.input)
n.rename_font(delugia)

# Other information
delugia.appendSFNTName("English (US)", "UniqueID", "{};{}".format(args.version, n.ps_fontname()))
delugia.appendSFNTName("English (US)", "UniqueID", "{};{}".format(args.version, n.psname()))
delugia.appendSFNTName("English (US)", "Trademark", "")

# Mix our version information in
delugia.sfntRevision = None # Auto-set (refreshed) by fontforge
delugia.appendSFNTName("English (US)", "Version", args.version)
delugia.version = args.version

if n.ps_fontname().lower().find("mono"):
if n.psname().lower().find("mono"):
# For MS-Windows console apps
panose = list(delugia.os2_panose)
if panose[0] < 3: # https://forum.high-logic.com/postedfiles/Panose.pdf
Expand Down

0 comments on commit afd3e45

Please sign in to comment.