From fc97d70b8ea090f74a48f57d71c80b6bb51f678e Mon Sep 17 00:00:00 2001 From: James Godfrey-Kittle Date: Tue, 9 Jun 2015 13:46:34 -0700 Subject: Correct family and style data in name table. This uncomments some code which distinguishes between Regular/Bold and other weights when setting the UFOs' styleMapFamilyName attribute, which is used by the FDK to set the output OTFs' family names (this association is documented here: http://unifiedfontobject.org/versions/ufo2/fontinfo.html). It's not clear why this code was commented out in the first place. Part of #37 --- scripts/lib/fontbuild/instanceNames.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'scripts/lib/fontbuild') diff --git a/scripts/lib/fontbuild/instanceNames.py b/scripts/lib/fontbuild/instanceNames.py index eab3024..743d390 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 -- cgit v1.2.3 From 3c2e6f24ab24a3595c1fa9a7a3bedfb12802834d Mon Sep 17 00:00:00 2001 From: James Godfrey-Kittle Date: Tue, 16 Jun 2015 10:51:14 -0700 Subject: Correctly set PostScript font name in UFOs. This propagates to name ID 6 in the name table, and font name info in the CFF table. --- scripts/lib/fontbuild/instanceNames.py | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/lib/fontbuild') diff --git a/scripts/lib/fontbuild/instanceNames.py b/scripts/lib/fontbuild/instanceNames.py index 743d390..effca86 100644 --- a/scripts/lib/fontbuild/instanceNames.py +++ b/scripts/lib/fontbuild/instanceNames.py @@ -76,6 +76,7 @@ class InstanceNames: f.info.openTypeNamePreferredSubfamilyName = self.longstyle 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 -- cgit v1.2.3 From 67add46136c5713518212a0714c4a3ea92ffb164 Mon Sep 17 00:00:00 2001 From: James Godfrey-Kittle Date: Mon, 22 Jun 2015 12:35:15 -0700 Subject: Explicitly set weight class in OS/2 table. Without this, ufo2fdk sets both Light and Regular to 400 by default. --- scripts/lib/fontbuild/instanceNames.py | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/lib/fontbuild') diff --git a/scripts/lib/fontbuild/instanceNames.py b/scripts/lib/fontbuild/instanceNames.py index effca86..281eb03 100644 --- a/scripts/lib/fontbuild/instanceNames.py +++ b/scripts/lib/fontbuild/instanceNames.py @@ -75,6 +75,7 @@ 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: -- cgit v1.2.3