Skip to content

Commit

Permalink
Merge pull request #51 from google/name-table-fix
Browse files Browse the repository at this point in the history
Correct metadata related to font names and weights.
  • Loading branch information
jamesgk committed Jun 22, 2015
2 parents 0efa603 + 67add46 commit f8d8004
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/lib/fontbuild/instanceNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ def __init__(self,names):
self.fullname = "%s %s" %(self.longfamily, self.longstyle)
self.postscript = re.sub(' ','', self.longfamily) + "-" + re.sub(' ','',self.longstyle)

# if self.subfamilyAbbrev != "" and self.subfamilyAbbrev != None and self.subfamilyAbbrev != "Rg":
# self.shortfamily = "%s %s" %(self.longfamily, self.subfamilyAbbrev)
# else:
# self.shortfamily = self.longfamily
self.shortfamily = self.longfamily
if self.subfamilyAbbrev != "" and self.subfamilyAbbrev != None and self.subfamilyAbbrev != "Rg":
self.shortfamily = "%s %s" %(self.longfamily, self.longstyle.split()[0])
else:
self.shortfamily = self.longfamily

def setRFNames(self,f, version=1, versionMinor=0):
f.info.familyName = self.longfamily
Expand Down Expand Up @@ -76,7 +75,9 @@ def setRFNames(self,f, version=1, versionMinor=0):
f.info.openTypeNamePreferredFamilyName = self.longfamily
f.info.openTypeNamePreferredSubfamilyName = self.longstyle

f.info.openTypeOS2WeightClass = self._getWeightCode(self.weight)
f.info.macintoshFONDName = re.sub(' ','',self.longfamily) + " " + re.sub(' ','',self.longstyle)
f.info.postscriptFontName = f.info.macintoshFONDName.replace(" ", "-")
if self.italic:
f.info.italicAngle = -12.0

Expand Down

0 comments on commit f8d8004

Please sign in to comment.