diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-25 16:48:42 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-25 16:48:42 -0400 |
commit | 0c7ad993f7f8cffcc3972a6f8e5517fd841051b5 (patch) | |
tree | 077d2c932c8239d30c2a30bccf4f538ecde9d712 /fonts/mkpsf.pl | |
parent | 5be52a355d63b93e1a9662ded6a1a5f682665699 (diff) | |
download | bw-atari8-tools-0c7ad993f7f8cffcc3972a6f8e5517fd841051b5.tar.gz |
fonts: much progress.
Diffstat (limited to 'fonts/mkpsf.pl')
-rw-r--r-- | fonts/mkpsf.pl | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/fonts/mkpsf.pl b/fonts/mkpsf.pl index a5dbaf8..ddcfc06 100644 --- a/fonts/mkpsf.pl +++ b/fonts/mkpsf.pl @@ -500,6 +500,19 @@ while($cnt < 512) { } #warn "$cnt characters with padding\n"; + +# What is dupglyphs.pl for? +# PSF allows the same glyph to represent multiple codepoints (e.g. +# space and NBSP, or hyphen/soft-hyphen/en-dash). We only get 512 +# glyphs max for a PSF, so we definitely want to use this. +# BDF on the other hand doesn't allow this. So if the same glyph +# data is to be used for multiple codepoints in BDF, the glyph data +# has to be repeated for each codepoint. Bloats the font, but not +# too much. The BDF is also what gets made into the TTF. I'm pretty +# sure TTF supports multiple codepoints per glyph, but until I +# learn some other way besides bitmapfont2ttf to generate the TTF, +# it also will have dup glyph bloat. On the bright side, dupglyphs.pl +# removes all the padding characters required by the psf font. sub mkfonts { my $px = shift; my $scaled_data = shift; @@ -509,8 +522,9 @@ sub mkfonts { print $fh psf2txt_header($cnt, $scale); print $fh $_ for(@$scaled_data); close $fh; + system("txt2psf $fontname-$px.txt $fontname-$px.psf"); - system("psf2bdf --iso10646 --fontname=$fontname-$px $fontname-$px.psf | perl ./fixbdf.pl $px > $fontname-$px.bdf"); + system("perl dupglyphs.pl $fontname-$px.txt | txt2psf | psf2bdf --iso10646 --fontname=$fontname-$px | perl ./fixbdf.pl $px > $fontname-$px.bdf"); } mkfonts(8, \@scale1, 1); |