]> git.pld-linux.org Git - packages/unifont.git/blame - hex2bdf
- packages require directory in which they have fonts
[packages/unifont.git] / hex2bdf
CommitLineData
5352f9fe 1#!/usr/bin/perl
2
3while (<>) { $glyph{$1} = $2 if /(....):(.+)\n/; }
4@chars = sort keys %glyph; $[ = 1;
5# dbmopen (%charname, "/usr/share/unicode/unidata/charname.db", 0);
6
7print "STARTFONT 2.1
8FONT -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1
9SIZE 16 75 75
10FONTBOUNDINGBOX 16 16 0 -2
11STARTPROPERTIES 3
12FONT_ASCENT 14
13FONT_DESCENT 2
14DEFAULT_CHAR 32
15ENDPROPERTIES
16CHARS $#chars\n";
17
18foreach $character (@chars)
19{
20 $encoding = hex($character); $glyph = $glyph{$character};
21 $width = length ($glyph) > 32 ? 2 : 1;
22 $dwidth = $width * 8; $swidth= $width * 500;
23 $glyph =~ s/((..){$width})/\n$1/g;
24 $character = "$character $charname"
25 if $charname = $charname{pack("n",hex($character))};
26
27 print "STARTCHAR U+$character
28ENCODING $encoding
29SWIDTH $swidth 0
30DWIDTH $dwidth 0
31BBX $dwidth 16 0 -2
32BITMAP $glyph
33ENDCHAR\n";
34}
35
36print "ENDFONT\n";
This page took 0.092661 seconds and 4 git commands to generate.