-#!/usr/local/bin/perl -w
+#!/usr/bin/perl -w
require 5.005;
use strict;
$fi{FontSpecificUnicodeNameToChar} = {};
$fi{filename} = $fn;
$fi{filename} =~ s/.*\///;
+ $fi{Ascender} = 0;
+ $fi{Descender} = 0;
open(FH, $fn) || die "Can't open $fn\n";
print STDERR "Reads global font info\n" if $q;
while (<FH>) {
chomp;
next if /^\s*$/ || /^\s*#/;
+ $fi{Ascender} = $1 if /^Ascender\s+(-?\d+)/;
+ $fi{Descender} = $1 if /^Descender\s+(-?\d+)/;
last if /^StartCharMetrics/;
next unless (/^(\S+)\s+(\S(.*\S)?)/);
my $id = $1;
$kerning_data_count + 2 * $highchars_count +
3 * 2 * $ligatures_count;
$info_code .= $indent1 . "{ /* $$fiR{filename} $packedSize bytes */\n";
- $info_code .= $i2 . "\"$$fiR{AfmFontName}\",";
- $info_code .= " \"$$fiR{AfmFullName}\",\n";
+ $info_code .= $i2 . "\"$$fiR{AfmFontName}\", \"$$fiR{AfmFullName}\",\n";
+ $info_code .= $i2 . $$fiR{Ascender} . ", " . $$fiR{Descender} . ",\n";
$info_code .= $i2 . $$fiR{widthsACName} . ",\n";
$info_code .= $i2 . $$fiR{kerning_indexACName} . ",\n";
$info_code .= $i2 . $$fiR{kerning_dataACName} . ",\n";
print CFILE ${$font_code{$_}}{TABLES} foreach @fonts;
print CFILE "const afm_fontinfo afm_fontinfolist[] = {\n";
print CFILE ${$font_code{$_}}{INFO} foreach @fonts;
- print CFILE $indent1 . "{ 0, 0, 0 }\n";
+ print CFILE $indent1 . "{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }\n";
print CFILE $indent0 . "};\n";
print CFILE $indent0 . "const int afm_fontinfo_count = ",
($#fonts + 1), ";\n";
const afm_fontinfo afm_fontinfolist[] = {
{ /* Courier.afm 761 bytes */
"Courier", "Courier",
+ 629, -157,
afm_Courier_widths,
NULL,
NULL,
afm_Courier_ligatures, 1},
{ /* Courier-Bold.afm 761 bytes */
"Courier-Bold", "Courier Bold",
+ 629, -157,
afm_Courier_Bold_widths,
NULL,
NULL,
afm_Courier_Bold_ligatures, 1},
{ /* Courier-BoldOblique.afm 761 bytes */
"Courier-BoldOblique", "Courier Bold Oblique",
+ 629, -157,
afm_Courier_BoldOblique_widths,
NULL,
NULL,
afm_Courier_BoldOblique_ligatures, 1},
{ /* Courier-Oblique.afm 761 bytes */
"Courier-Oblique", "Courier Oblique",
+ 629, -157,
afm_Courier_Oblique_widths,
NULL,
NULL,
afm_Courier_Oblique_ligatures, 1},
{ /* Helvetica.afm 7841 bytes */
"Helvetica", "Helvetica",
+ 718, -207,
afm_Helvetica_widths,
afm_Helvetica_kerning_index,
afm_Helvetica_kerning_data,
afm_Helvetica_ligatures, 1},
{ /* Helvetica-Bold.afm 7336 bytes */
"Helvetica-Bold", "Helvetica Bold",
+ 718, -207,
afm_Helvetica_Bold_widths,
afm_Helvetica_Bold_kerning_index,
afm_Helvetica_Bold_kerning_data,
afm_Helvetica_Bold_ligatures, 1},
{ /* Helvetica-BoldOblique.afm 7336 bytes */
"Helvetica-BoldOblique", "Helvetica Bold Oblique",
+ 718, -207,
afm_Helvetica_BoldOblique_widths,
afm_Helvetica_BoldOblique_kerning_index,
afm_Helvetica_BoldOblique_kerning_data,
afm_Helvetica_BoldOblique_ligatures, 1},
{ /* Helvetica-Oblique.afm 7841 bytes */
"Helvetica-Oblique", "Helvetica Oblique",
+ 718, -207,
afm_Helvetica_Oblique_widths,
afm_Helvetica_Oblique_kerning_index,
afm_Helvetica_Oblique_kerning_data,
afm_Helvetica_Oblique_ligatures, 1},
{ /* ZapfDingbats.afm 416 bytes */
"ZapfDingbats", "ITC Zapf Dingbats",
+ 0, 0,
afm_ZapfDingbats_widths,
NULL,
NULL,
NULL, 0},
{ /* Symbol.afm 563 bytes */
"Symbol", "Symbol",
+ 0, 0,
afm_Symbol_widths,
NULL,
NULL,
NULL, 0},
{ /* Times-Bold.afm 6761 bytes */
"Times-Bold", "Times Bold",
+ 683, -217,
afm_Times_Bold_widths,
afm_Times_Bold_kerning_index,
afm_Times_Bold_kerning_data,
afm_Times_Bold_ligatures, 1},
{ /* Times-BoldItalic.afm 6270 bytes */
"Times-BoldItalic", "Times Bold Italic",
+ 683, -217,
afm_Times_BoldItalic_widths,
afm_Times_BoldItalic_kerning_index,
afm_Times_BoldItalic_kerning_data,
afm_Times_BoldItalic_ligatures, 1},
{ /* Times-Italic.afm 6975 bytes */
"Times-Italic", "Times Italic",
+ 683, -217,
afm_Times_Italic_widths,
afm_Times_Italic_kerning_index,
afm_Times_Italic_kerning_data,
afm_Times_Italic_ligatures, 1},
{ /* Times-Roman.afm 6287 bytes */
"Times-Roman", "Times Roman",
+ 683, -217,
afm_Times_Roman_widths,
afm_Times_Roman_kerning_index,
afm_Times_Roman_kerning_data,
afm_Times_Roman_highchars_index, 220,
afm_Times_Roman_ligatures, 1},
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
const int afm_fontinfo_count = 14;