my $fdata = "";
my $fsize = 0;
- my $i;
my @bdata;
open FH, "<$TEMP.ttf";
$fsize = -s FH;
read FH, $fdata, $fsize;
close FH;
- @bdata = unpack("C*", $fdata);
- for($i = 0; $i < $fsize - 23; $i++){
- if($bdata[$i] == ord("P") && $bdata[$i+1] == ord("f") && $bdata[$i+2] == ord("E") && $bdata[$i+3] == ord("d")){
- #$bdata[$i-5] = 0x10;
- for($j = 0; $j < 16; $j++){
- if($unicoderange[$j] ne "--"){
- $bdata[$i-16+$j] = eval('0x'.$unicoderange[$j]);
- }
- }
- #$bdata[$i+20] = 0x80; # Symbol
- #$bdata[$i+21] = 0x02; # JIS/Japan
- #$bdata[$i+22] = 0x00;
- #$bdata[$i+23] = 0x03; # Latin 1 & 2
- for($j = 0; $j < 4; $j++){
- $bdata[$i+20+$j] = eval('0x'.$codepagerange[$j]);
- }
- }
- }
- $fdata = pack("C*", @bdata);
- #open FH, ">./$fontname.ttf";
- #print FH $fdata;
- #close FH;
print <<"EOT";
Content-type: application/octet-stream
Content-Disposition: attachment; filename = $fontname_en.ttf