2023-02-10 17:24:54 +02:00
|
|
|
#!/usr/bin/env python3
|
2023-11-26 19:49:56 +02:00
|
|
|
# Nerd Fonts Version: 3.1.1
|
2023-02-15 17:40:41 +02:00
|
|
|
# Script Version: 1.1.0
|
2023-02-10 17:24:54 +02:00
|
|
|
# Generates extrasymbols.sfd from Hack
|
|
|
|
|
|
|
|
import os
|
|
|
|
import fontforge
|
|
|
|
|
|
|
|
srcdir = '../../src'
|
|
|
|
srcfont = 'unpatched-fonts/Hack/Regular/Hack-Regular.ttf'
|
|
|
|
outfont = 'glyphs/extraglyphs.sfd'
|
|
|
|
|
2023-02-14 11:10:22 +02:00
|
|
|
print('Opening {}'.format(srcfont))
|
2023-02-10 17:24:54 +02:00
|
|
|
font = fontforge.open(os.path.join(srcdir, srcfont))
|
|
|
|
|
|
|
|
font.selection.select(
|
|
|
|
0x276C, # medium left-pointing angle bracket
|
|
|
|
0x276D, # medium right-pointing angle bracket
|
|
|
|
0x276E, # heavy left-pointing angle quotation mark
|
|
|
|
0x276F, # heavy right-pointing angle quotation mark
|
|
|
|
0x2770, # heavy left-pointing angle bracket
|
|
|
|
0x2771, # heavy right-pointing angle bracket
|
|
|
|
)
|
2023-02-15 17:40:41 +02:00
|
|
|
font.selection.select(("more", "ranges"), 0x2500, 0x25A0) # Box drawing glyphs
|
2023-02-10 17:24:54 +02:00
|
|
|
|
|
|
|
num_icons = len(list(font.selection))
|
|
|
|
|
|
|
|
font.selection.invert()
|
|
|
|
font.clear()
|
|
|
|
|
|
|
|
print('Generating {} with {} glyphs'.format(outfont, num_icons))
|
|
|
|
font.generate(os.path.join(srcdir, outfont), flags=("no-FFTM-table",))
|
|
|
|
font.close()
|