3 # Copyright (C) 2005 Luis Gonzalez Miranda
5 # hex2sfd created in 2005 by Luis Gonzalez Miranda, http://www.lgm.cl
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 # open(A, "<combining.txt");
31 # Modified by Paul Hardy, June 2008.
33 # The original code above didn't work properly. The replacement code
34 # below wastes RAM, but it works as a quick fix.
37 for ($i = 0; $i < 65536; $i++) {
40 open(A, "<combining.txt");
43 $combining[ hex($_) ] = 1;
47 # Modified by Paul Hardy, July 2008.
49 # Make pixel 64 units for greatest scale; floating point numbers in
50 # TrueType have 6 fractional bits, so this works out well (2^6 = 64).
51 # Also, make size of font a power of 2 (16 * 64) for efficient scaling
52 # to any point size in TrueType. Made bitmask a variable for easy
56 $descent = 2 * $pixel;
57 $ascent = 16 * $pixel - $descent;
58 $bitmask = 25; # round in x (doesn't really work), corner point selected
66 Comments: Created from the 2008-07-06 version of the GNU Unifont
67 Comments: with Luis Gonzalez Miranda's Perl and FontForge scripts.
68 Comments: See http://www.lgm.cl/trabajos/unifont/index.en.html for
69 Comments: information on Luis' scripts.
70 Comments: See http://czyborra.com/unifont
71 Comments: and http://unifoundry.com/unifont.html
72 Comments: for information on GNU Unifont.
73 Comments: See http://fontforge.sf.net for information on FontForge.
76 UnderlinePosition: -100
81 XUID: [1021 140 1293607838 5610107]
86 Panose: 2 0 6 4 0 0 0 0 0 0
105 TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144
113 $ptwidth=$pixel * $width;
114 # if($combining{$c}) { # this was the original "if"
115 if ($combining[ hex($c) ]) {
119 # Changed "Flags: H" to "Flags: HW" to fix spaces - Paul Hardy, 2008
122 Encoding: $cn $cn $count
129 for($i=0;$i<16;$i++) {
130 $l=substr($d, $i*$width/4, $width/4);
133 for($j=0; $j<$width; $j++) {
137 # point at i, width-1-j
139 $x1=$x * $pixel + $pixel;
140 $y1=$y * $pixel - $descent;
147 $x2=$x * $pixel + $pixel;