summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk19@gmail.com>2015-06-22 15:22:55 -0700
committerJames Godfrey-Kittle <jamesgk19@gmail.com>2015-06-22 15:22:55 -0700
commitf8d800450adef5fc506fb2dd11aa6201fce71a5b (patch)
tree5184696b00fa28a08dc69ee7b89b2fdfa1e30538
parent0efa603cda97c9920ebb377ac8883dbef671e1aa (diff)
parent67add46136c5713518212a0714c4a3ea92ffb164 (diff)
Merge pull request #51 from google/name-table-fix
Correct metadata related to font names and weights.
-rw-r--r--scripts/lib/fontbuild/instanceNames.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/lib/fontbuild/instanceNames.py b/scripts/lib/fontbuild/instanceNames.py
index eab3024..281eb03 100644
--- a/scripts/lib/fontbuild/instanceNames.py
+++ b/scripts/lib/fontbuild/instanceNames.py
@@ -44,11 +44,10 @@ class InstanceNames:
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
@@ -76,7 +75,9 @@ class InstanceNames:
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