~ft/ttfs

Plan9Font: TrueType fell off
readme: show how to compress fonts on plan 9
savesubfont: fix off by one
fix issues detected with clang analyzer

refs

front
browse  log 

clone

read-only
https://git.sr.ht/~ft/ttfs
read/write
git@git.sr.ht:~ft/ttfs

You can also use your local clone with git send-email.

#ttfs

WIP. For now it's a pretty dumb TTF/OTF/BDF→Plan9Font converter that runs on Unix-like operating systems. It also requires fc-query executable to be available, sorry... also SDL and SDL_ttf :'(

It took a few hours to implement, as an exercise.

Selling point: "replacement character" is a vectorized PJW by default.

#Usage

# on Linuks
ttfs -s 32 ~/.fonts/Symbola.ttf symbola/symbola.32

# fonts can be combined too
ttfs -s 16 unifont.otf  unifont_csur.otf  unifont_jp.otf  unifont_upper.otf unifont/unifont.16

# can do nearest-neighbour scaling (x2 in this example)
ttfs -s 10 -x 2 blah.otb blah/blah.20

# on Plan 9
mkdir /lib/font/bit/symbola
cp /n/mylinuks/pr0n/symbola/* /lib/font/bit/symbola/
# compress the fonts
for(f in /lib/font/bit/symbola/*.*-*){
	{iconv; cat} <$f >$f.cmp && mv $f.cmp $f
}
font=/lib/font/bit/symbola/symbola.32.font
rio

#TODO

  • make it a 9p filesystem like truetypefs(4).
  • save fonts compressed
  • documentation