|
Packit |
f0e7df |
__license__ = """
|
|
Packit |
f0e7df |
This file is part of Gnu FreeFont.
|
|
Packit |
f0e7df |
|
|
Packit |
f0e7df |
Gnu FreeFont is free software: you can redistribute it and/or modify it under
|
|
Packit |
f0e7df |
the terms of the GNU General Public License as published by the Free Software
|
|
Packit |
f0e7df |
Foundation, either version 3 of the License, or (at your option) any later
|
|
Packit |
f0e7df |
version.
|
|
Packit |
f0e7df |
|
|
Packit |
f0e7df |
Gnu FreeFont is distributed in the hope that it will be useful, but WITHOUT
|
|
Packit |
f0e7df |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
Packit |
f0e7df |
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
Packit |
f0e7df |
|
|
Packit |
f0e7df |
You should have received a copy of the GNU General Public License along with
|
|
Packit |
f0e7df |
Gnu FreeFont. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
f0e7df |
"""
|
|
Packit |
f0e7df |
__author__ = "Stevan White"
|
|
Packit |
f0e7df |
__email__ = "stevan.white@googlemail.com"
|
|
Packit |
f0e7df |
__copyright__ = "Copyright 2011, 2012, Stevan White"
|
|
Packit |
f0e7df |
__date__ = "$Date: 2012-04-24 13:10:12 +0200 (Tue, 24 Apr 2012) $"
|
|
Packit |
f0e7df |
__version__ = "$Revision: 2246 $"
|
|
Packit |
f0e7df |
__doc__ = """
|
|
Packit |
f0e7df |
Common tools used by the generate scripts.
|
|
Packit |
f0e7df |
"""
|
|
Packit |
f0e7df |
|
|
Packit |
f0e7df |
import re
|
|
Packit |
f0e7df |
|
|
Packit |
f0e7df |
_re_vstr = re.compile( '\$Revision: (\d*)\s*\$(.*)' )
|
|
Packit |
f0e7df |
|
|
Packit |
f0e7df |
def trim_version_str( font ):
|
|
Packit |
f0e7df |
""" SVN automatically puts a revision number between dollar signs
|
|
Packit |
f0e7df |
in the sfd file's Version string.
|
|
Packit |
f0e7df |
However the OpenType standard recommends
|
|
Packit |
f0e7df |
Version n.m
|
|
Packit |
f0e7df |
Where n and m are decimal numbers.
|
|
Packit |
f0e7df |
"""
|
|
Packit |
f0e7df |
vstr_match = _re_vstr.match( font.version )
|
|
Packit |
f0e7df |
ot_stdized = ''
|
|
Packit |
f0e7df |
if vstr_match:
|
|
Packit |
f0e7df |
trimmed = vstr_match.group( 1 )
|
|
Packit |
f0e7df |
rest = vstr_match.group( 2 )
|
|
Packit |
f0e7df |
otstdized = '0412.' + trimmed + rest
|
|
Packit |
f0e7df |
font.version = otstdized
|
|
Packit |
f0e7df |
#font.appendSFNTName( n[0], n[1], otstdized )
|
|
Packit |
f0e7df |
return trimmed
|
|
Packit |
f0e7df |
return otstdized
|
|
Packit |
f0e7df |
|