mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-12-13 17:18:37 +02:00
40d82b0a0a
[why] We print two times the name of the output font, and never the name of the input font... [how] *cough* Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
33 lines
907 B
Python
Executable File
33 lines
907 B
Python
Executable File
#!/usr/bin/env python3
|
|
# Nerd Fonts Version: 2.3.3
|
|
# Script Version: 1.0.1
|
|
# Generates extrasymbols.sfd from Hack
|
|
|
|
import os
|
|
import fontforge
|
|
|
|
srcdir = '../../src'
|
|
srcfont = 'unpatched-fonts/Hack/Regular/Hack-Regular.ttf'
|
|
outfont = 'glyphs/extraglyphs.sfd'
|
|
|
|
print('Opening {}'.format(srcfont))
|
|
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
|
|
)
|
|
|
|
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()
|