aboutsummaryrefslogtreecommitdiff
path: root/fonts/mkpsf.pl
diff options
context:
space:
mode:
Diffstat (limited to 'fonts/mkpsf.pl')
-rw-r--r--fonts/mkpsf.pl16
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);