Skip to content

Commit

Permalink
feat: bdf2ttf build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidZORO committed Oct 8, 2020
1 parent a944551 commit ef9f9f5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
Binary file added tools/bin/BitsNPicas.jar
Binary file not shown.
1 change: 1 addition & 0 deletions tools/bin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/kreativekorp/bitsnpicas
11 changes: 11 additions & 0 deletions tools/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/bash

cd "$(dirname "$0")" || exit

rm -f ./*.ttf

java -jar ./bin/BitsNPicas.jar convertbitmap -f ttf -o ./zpix.ttf ../src/zpix.bdf

./minify.py

mv -f ./zpix.ttf ../dist/zpix.ttf
24 changes: 24 additions & 0 deletions tools/minify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env fontforge
# -*- mode: python; coding: utf-8 -*-

from bdflib import reader
from bdflib import writer
import fontforge

baseFont = fontforge.open("./zpix.ttf")
print(' ')
print(' ')
print(baseFont)
print('------------')

# AutoTrace all glyphs, add extrema and simplify.
print('Processing...')
baseFont.selection.all()
baseFont.autoTrace()
baseFont.addExtrema()
baseFont.simplify()
baseFont.generate('zpix.ttf', 'ttf')

print(' ')
print('🚀 Done!')
print(' ')

0 comments on commit ef9f9f5

Please sign in to comment.