Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit21238cae7095f819ac58417332a18be2cd70b253 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-09-08 22:21:32 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-09-08 22:21:32 +0300
Files26e63c6cbc22ab5d33bdfce2896f935090186e2d
syndamia.com-21238cae7095f819ac58417332a18be2cd70b253.tar
syndamia.com-21238cae7095f819ac58417332a18be2cd70b253.tar.gz
syndamia.com-21238cae7095f819ac58417332a18be2cd70b253.zip
Parent0570893fbfe1db1e3dd8e7e04f458a1ef19b79ab (diff)
[font] Updated font script to be more automatic and added space and hyphen from noto-sans
2 files changed, 41 insertions, 4 deletions
-rwxr-xr-xcreate-font.sh (renamed from FontForge-helper.ff)45
-rw-r--r--src/font/tabler-icons-subset.ttfbin7072 -> 6292 bytes
diff --git a/FontForge-helper.ff b/create-font.sh
index 6e7db90..e3e1afc 100755
--- a/FontForge-helper.ff
+++ b/create-font.sh
@@ -1,7 +1,22 @@
+#!/bin/bash
+# This is a script for automatically generating my font.
+# It will be ran only when I want to make changes to the font.
+
+pushd .
+cd /tmp
+
+wget -N 'https://github.com/tabler/tabler-icons/releases/download/v2.10.0/tabler-icons-2.10.0.zip'
+unzip -oj 'tabler-icons-2.10.0.zip' 'webfont/fonts/tabler-icons.ttf'
+
+# I actually take the space and hyphen from noto-sans, because tabler-icons doesn't have it, and
+# because it drastically helps with rendering on MacOS (and especially Safari)
+wget -N 'https://www.fontsquirrel.com/fonts/download/noto-sans'
+unzip -oj 'noto-sans' 'NotoSans-Regular.ttf'
+
+cat << EOF > ./editfonts.ff
#!/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)
+# Requires two arguments - filepaths for tabler-icons.ttf and NotoSans-Regular.ttf
# 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
@@ -12,7 +27,12 @@
# all other icons.
# This is a FontForge script which automates the whole process.
-Open($1)
+
+#
+# Tabler icons
+#
+
+Open(\$1)
Select("uea19") # arrow-left
SelectMore("uea1f") # arrow-right
@@ -73,4 +93,21 @@ Select("ueb70"); Cut(); Select("u239A"); Paste()
# printer to ⎙ print screen symbol
Select("ueb0e"); Cut(); Select("u2399"); Paste()
-Generate("./src/font/tabler-icons-subset.ttf")
+#
+# Noto-sans icons
+#
+
+Open(\$2)
+
+ Select("u0020") # space
+SelectMore("u002D") # hyphen
+
+Copy(); Open(\$1); Paste()
+
+Generate("tabler-icons-subset.ttf")
+EOF
+chmod +x ./editfonts.ff
+
+./editfonts.ff 'tabler-icons.ttf' 'NotoSans-Regular.ttf'
+popd
+mv /tmp/tabler-icons-subset.ttf ./src/font/
diff --git a/src/font/tabler-icons-subset.ttf b/src/font/tabler-icons-subset.ttf
index c1c4b5c..86878ab 100644
--- a/src/font/tabler-icons-subset.ttf
+++ b/src/font/tabler-icons-subset.ttf
Binary files differ