summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/MacTT
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/MacTT')
-rwxr-xr-xMaster/texmf-dist/doc/fonts/gnu-freefont/tools/generate/MacTT54
1 files changed, 54 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/MacTT b/Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/MacTT
new file mode 100755
index 00000000000..30d19e151f0
--- /dev/null
+++ b/Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/MacTT
@@ -0,0 +1,54 @@
+# vim: set filetype=python :
+__license__ = """
+This file is part of Gnu FreeFont.
+
+Gnu FreeFont is free software: you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation, either version 3 of the License, or (at your option) any later
+version.
+
+Gnu FreeFont is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+Gnu FreeFont. If not, see <http://www.gnu.org/licenses/>.
+"""
+__author__ = "Stevan White"
+__email__ = "stevan.white@googlemail.com"
+__copyright__ = "Copyright 2009, 2010, 2012, Stevan White"
+__date__ = "$Date: 2012-04-21 18:47:22 +0200 (Sat, 21 Apr 2012) $"
+__version__ = "$Revision: 2231 $"
+
+__doc__ = """
+Convert fonts from FontForge's native SFD format to TrueType format
+First auto-hints whole font
+
+Old-style kern tables seem to be what is actually used by Windows and
+some Linux programs such as OpenOffice.
+
+According to the FAQ, need to pass Flags=(apple) to build Mac fonts.
+But this option seems to rule out old-style kern tables
+"""
+
+import fontforge
+from sys import argv
+from buildutils import *
+
+scriptname = argv[0];
+argc = len( argv )
+
+if argc > 1:
+ for i in range( 1, argc ):
+ f = fontforge.open( argv[i] )
+ ttfile = f.fontname + ".mac.ttf"
+ vstr = trim_version_str( f )
+ print "Generating Mac TrueType file ", ttfile, ' ', vstr
+ f.selection.all()
+ f.autoHint()
+ f.autoInstr()
+ # Mac OS Font Book doesn't like the old-kern flag
+ #f.generate( ttfile, flags=('opentype','old-kern') )
+ f.close()
+else:
+ print "Usage: " + scriptname + " font.sfd [font.sfd ...]"