Summary Files Commits Branches @commit @diff @stats
path: root / FontForge-helper.ff
blob: 81c87bcbeaa5696000201dbaee267992f6433b14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/fontforge
# Updates ./src/font/tabler-icons-subset.ttf font file
# Requires one argument - filepath to complete tabler-icons.ttf file
# Must be ran from the root of the repository (i.e. from the location of the script)

# Icons on my website are just characters inside a special font.
# That font is a subset of the "Tabler Icons" font, version 2.10.0, containing only the glyphs I use
# https://github.com/tabler/tabler-icons
# The way I do it is oystersauce's idea
# https://stackoverflow.com/a/35754448/12036073
# Basically I select the icons I want, invert selection, then detach and remove
# all other icons.
# This is a FontForge script which automates the whole process.

Open($1)

    Select("uea19") # arrow-left
SelectMore("uea1c") # arrow-right
SelectMore("uf7d6") # arrow-badge-down-filled
SelectMore("uf7d9") # arrow-badge-up-filled
SelectMore("uf1e2") # article
SelectMore("uea66") # chevrons-up
SelectMore("ueaa2") # file-text
SelectMore("ued4e") # file-zip
SelectMore("ueaaa") # folder-minus
SelectMore("ueaab") # folder-plus
SelectMore("ueaad") # folder
SelectMore("ueade") # link
SelectMore("ueade") # markdown
SelectMore("ueafa") # movie
SelectMore("ueb0a") # photo
SelectMore("ueb70") # presentation
SelectMore("ueb0e") # printer

SelectInvert()
DetachAndRemoveGlyphs()
Generate("./src/font/tabler-icons-subset.ttf")