
git-svn-id: https://mathjax.svn.sourceforge.net/svnroot/mathjax/trunk@546 b8fd5906-0fad-46e2-a0d3-10d94ff285d1
38 lines
916 B
Perl
Executable File
38 lines
916 B
Perl
Executable File
#! /usr/bin/perl
|
|
|
|
# Creates the fontdata.js file from the individual font data files
|
|
#
|
|
# Usage: ./makeData
|
|
|
|
@files = (
|
|
"STIXGeneral-Regular",
|
|
"STIXGeneral-Bold",
|
|
"STIXGeneral-Italic",
|
|
"STIXIntegralsD-Regular",
|
|
"STIXNonUnicode-Regular",
|
|
"STIXNonUnicode-Bold",
|
|
"STIXNonUnicode-Italic",
|
|
"STIXSizeOneSym-Regular",
|
|
"STIXSizeTwoSym-Regular",
|
|
"STIXSizeThreeSym-Regular",
|
|
"STIXSizeFourSym-Regular",
|
|
"STIXSizeFiveSym-Regular",
|
|
"STIXVariants-Regular",
|
|
);
|
|
|
|
open(DATA,">fontdata.js");
|
|
foreach $file (@files) {
|
|
$file =~ s/STIX//;
|
|
$file .= "-Regular" unless $file =~ m/-/;
|
|
$file = "fonts/STIX/$file"; $file =~ s!-!/!g;
|
|
$file .= (-e "$file/Main.js" ? "/Main.js" : "/All.js");
|
|
open(FONT,$file) || print "Can't open $file\n";
|
|
$lines = " ".join(" ",<FONT>);
|
|
close(FONT);
|
|
$lines =~ s/.*FONTDATA/ HTMLCSS.FONTDATA/s;
|
|
$lines =~ s/};.*/};\n/s;
|
|
print DATA $lines,"\n";
|
|
}
|
|
close(DATA);
|
|
|