Skip to content

Commit

Permalink
Completely reworked to use sfd files instead of svg and ttc instead o…
Browse files Browse the repository at this point in the history
…f ttf/otf (#9)

* use reference glyphs

* fixed a derp

* ...i messed up, this fixes my mess up

* use sfd instead of svg

* use exceptions for error handling

* 🅱️

* ⛳🅱️

* awoo

* fix readme

* update README.md

* added release mode

* update readme.md

* fix typo

* fixed placement of 6 char long codepoints

* tweaked horizontal spacing of glyphs

* detect adjacent instead of overlapped ranges

* formatting

* quotes

* minor fixes

Bar updates correctly
Files are named correctly
Release build now operates in the correct range

* use custom formatter class for ranges
  • Loading branch information
udf authored and JuanPotato committed Aug 31, 2017
1 parent b4b8327 commit 6bb075a
Show file tree
Hide file tree
Showing 3 changed files with 572 additions and 177 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Tofu

![screenshot](example.png)
For the curious, this is [font-mananager](https://fontmanager.github.io/)
![screenshot](example.png)
For the curious, this is [font-manager](https://fontmanager.github.io/)

### What is this?
This is an attempt by me to make a font that is just a box with the unicode code point inside. These are usually not in a font but rather programmatically generated by programs as they encounter characters that have no associated glyph.
This is an attempt by me to make a font (collection) that is just a box with the unicode code point inside. These are usually not in a font but rather programmatically generated by programs as they encounter characters that have no associated glyph.

### Why?
Because I wanted zero width characters in my code to be not zero width. I was trying out vss code (pretty nice imo) and found I should be able to use some CSS magic to make it so that certain characters are displayed by this font. ([see also](https://graphicdesign.stackexchange.com/questions/95687/making-a-tofu-font))

### Things that need to get fixed
* It's not very readable when small. Make better tofu template
* Fontforge python lib is sometimes screwy. Find better library
* The size of the generated font collection can probably be made smaller (for example by excluding unassigned characters)
* The progress bar isn't smooth since the fontforge lib provides no way to measure its progress when loading the generated .sfd files

### This is stupid
Yeah probably, but for its very specific use case it's not terribly bad.
Expand All @@ -21,10 +22,12 @@ Caching should take care of the intensive IO issue, if not then use a ramdisk.

I used python3 for this, it may work in python2. If it does not please feel free to make a pull request to fix it but I am not actively supporting python2.

The syntax for the program is as follows. `gen_tofu.py 0000 FFFD -o`
`0000` is the start
`FFFD` is the end
`-o` makes it output otf rather than ttf (should make this default, ttf screws up more in fontforge than otf)
The syntax for the program is as follows. `gen_tofu.py 0000-FFFD [10000-1FFFF] [-s X]`
`0000` is the start of the first range
`FFFD` is the end of the first range
`10000` is the start of the second range (optional, you can use as many ranges as you want)
`1FFFF` is the end of the second range (optional)
`X` is the number of characters that each font will contain (optional)

### License
MIT, not sure if the font needs a special license. ▯
Loading

0 comments on commit 6bb075a

Please sign in to comment.