Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #149 from jamesgk/android
Browse files Browse the repository at this point in the history
Fix various regressions from current Android binaries
  • Loading branch information
jamesgk committed Feb 3, 2016
2 parents 6831ae5 + d5c88ad commit 978fcd5
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 3 deletions.
3 changes: 3 additions & 0 deletions scripts/lib/fontbuild/Build.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ def generateFont(self, mix, names, italic=False, swapSuffixes=None, stemWidth=18
if g.width != 0:
g.width += 10

# set the oblique flag in fsSelection
f.info.openTypeOS2Selection.append(9)

if swapSuffixes != None:
for swap in swapSuffixes:
swapList = [g.name for g in f if g.name.endswith(swap)]
Expand Down
4 changes: 2 additions & 2 deletions scripts/lib/fontbuild/instanceNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def setRFNames(self,f, version=1, versionMinor=0):
f.info.openTypeNameManufacturerURL = self.foundry + ".com"
f.info.openTypeNameLicense = self.license
f.info.openTypeNameLicenseURL = self.licenseURL
f.info.openTypeNameVersion = "%i.%i" %(version,versionMinor)
f.info.openTypeNameUniqueID = "%s:%s:%s" %(self.foundry, self.longfamily, self.year)
f.info.openTypeNameVersion = "Version %i.%i" %(version,versionMinor)
f.info.openTypeNameUniqueID = "%s:%s:%s" %(self.foundry, self.fullname, self.year)
# f.info.openTypeNameDescription = ""
# f.info.openTypeNameCompatibleFullName = ""
# f.info.openTypeNameSampleText = ""
Expand Down
6 changes: 6 additions & 0 deletions scripts/run_android_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class TestCharacterCoverage(font_tests.TestCharacterCoverage):
range(0xE000, 0xF8FF + 1) + range(0xF0000, 0x10FFFF + 1) # other PUA
) - include # don't exclude legacy PUA

def test_only_includes_format_12_cmaps(self):
"""Test that only format 12 cmaps are present in the fonts."""

for font in self.fonts:
self.assertFalse([t for t in font['cmap'].tables if t.format != 12])


class TestSpacingMarks(font_tests.TestSpacingMarks):
loaded_fonts = FONTS
Expand Down
3 changes: 2 additions & 1 deletion scripts/run_general_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class TestMetaInfo(font_tests.TestMetaInfo):

loaded_fonts = FONTS
mark_heavier_as_bold = False
mark_italic_as_oblique = True
test_us_weight = None

#expected_version = '2.' + roboto_data.get_build_number()
Expand All @@ -72,7 +73,7 @@ class TestNames(font_tests.TestNames):
expected_copyright = 'Copyright 2011 Google Inc. All Rights Reserved.'

def expected_unique_id(self, family, style):
return 'Google:%s:2015' % family
return 'Google:%s %s:2016' % (family, style)


class TestDigitWidths(font_tests.TestDigitWidths):
Expand Down
3 changes: 3 additions & 0 deletions scripts/touchup_for_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def apply_android_specific_fixes(font):
for table in ['LTSH', 'hdmx', 'VDMX', 'gasp']:
if table in font:
del font[table]
cmap = font['cmap']
cmap.tables = [t for t in cmap.tables if t.format == 12]
assert cmap.tables, 'No format 12 cmap found in font'

# Set bold bits for Black (macStyle bit 0, fsSelection bit 5, subfamily)
name_records = font_data.get_name_records(font)
Expand Down
6 changes: 6 additions & 0 deletions src/v2/Roboto_Bold.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
<string>2008/09/12 12:29:34</string>
<key>openTypeHeadFlags</key>
<array>
<integer>0</integer>
<integer>1</integer>
<integer>3</integer>
<integer>4</integer>
</array>
<key>openTypeHeadLowestRecPPEM</key>
<integer>9</integer>
<key>openTypeHheaAscender</key>
<integer>2146</integer>
<key>openTypeHheaDescender</key>
Expand Down
Binary file removed src/v2/Roboto_Bold.vfb
Binary file not shown.
6 changes: 6 additions & 0 deletions src/v2/Roboto_Regular.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
<string>2008/09/12 12:29:34</string>
<key>openTypeHeadFlags</key>
<array>
<integer>0</integer>
<integer>1</integer>
<integer>3</integer>
<integer>4</integer>
</array>
<key>openTypeHeadLowestRecPPEM</key>
<integer>9</integer>
<key>openTypeHheaAscender</key>
<integer>2146</integer>
<key>openTypeHheaDescender</key>
Expand Down
Binary file removed src/v2/Roboto_Regular.vfb
Binary file not shown.
6 changes: 6 additions & 0 deletions src/v2/Roboto_Thin.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
<string>2008/09/12 12:29:34</string>
<key>openTypeHeadFlags</key>
<array>
<integer>0</integer>
<integer>1</integer>
<integer>3</integer>
<integer>4</integer>
</array>
<key>openTypeHeadLowestRecPPEM</key>
<integer>9</integer>
<key>openTypeHheaAscender</key>
<integer>2146</integer>
<key>openTypeHheaDescender</key>
Expand Down
Binary file removed src/v2/Roboto_Thin.vfb
Binary file not shown.

0 comments on commit 978fcd5

Please sign in to comment.