summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/buildutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/buildutils.py')
-rw-r--r--Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/buildutils.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/buildutils.py b/Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/buildutils.py
new file mode 100644
index 00000000000..c723e056e59
--- /dev/null
+++ b/Master/texmf-dist/doc/fonts/gnu-freefont/tools/generate/buildutils.py
@@ -0,0 +1,46 @@
+__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 2011, 2012, Stevan White"
+__date__ = "$Date: 2012-04-24 13:10:12 +0200 (Tue, 24 Apr 2012) $"
+__version__ = "$Revision: 2246 $"
+__doc__ = """
+Common tools used by the generate scripts.
+"""
+
+import re
+
+_re_vstr = re.compile( '\$Revision: (\d*)\s*\$(.*)' )
+
+def trim_version_str( font ):
+ """ SVN automatically puts a revision number between dollar signs
+ in the sfd file's Version string.
+ However the OpenType standard recommends
+ Version n.m
+ Where n and m are decimal numbers.
+ """
+ vstr_match = _re_vstr.match( font.version )
+ ot_stdized = ''
+ if vstr_match:
+ trimmed = vstr_match.group( 1 )
+ rest = vstr_match.group( 2 )
+ otstdized = '0412.' + trimmed + rest
+ font.version = otstdized
+ #font.appendSFNTName( n[0], n[1], otstdized )
+ return trimmed
+ return otstdized
+