Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .ttf convert script #14

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

k-cybulski
Copy link

This pull request adds a convert-ttf.sh script that generates creep.ttf with correct character widths and heights when font size is 9pt, that is without unnecessary space between letters/lines.

Just running Generate("creep.","ttf") in convert.pe results in a .ttf with wrong dimensions, and my terminal emulator (termite) doesn't allow vertical spacing tuning to make it more compact.

This requires re-importing the bitmaps in a smaller size. The actual
bitmap images are the same, but font forge cannot perform this step
within a script automatically.
@k-cybulski
Copy link
Author

With this each monospace cell is 5x12, looking like this; the ttf conversion process is a bit unwieldy.
1575152190

@romeovs
Copy link
Owner

romeovs commented Jul 12, 2021

This script seems to work but the generated ttf file seems to be empty for me, am I doing something wrong?

@k-cybulski
Copy link
Author

Looking a bit deeper into it, the output font creep.ttf (md5sum efbcbff37ce040c77a0c5a1219f6adf2) simply contains the creep bitmap font embedded in the ttf's EBDT table, but is otherwise empty. This works for some usecases (e.g. my terminal emulator termite accepts it without issue) but is probably not sufficient for many other times when you'd want to use a ttf font (it's empty in fontdrop and e.g. Intellij IDEA). The reason this happens is because I just naively use fontforge's Generate function with bitmaptype as ttf, which simply embeds data in the EBDT table but doesn't do any smart bitmap-to-vector conversion magic.

So, the ttf file you get at the end is not empty, but is usable only in limited cases like some terminal emulators. Unfortunately, I'm afraid getting it to work more robustly would require actually doing the bitmap -> vector conversion, which I suspect is a lot more work.

@zoomlogo
Copy link

@k-cybulski @romeovs How about using BitnPicas for ttf generation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants