Skip to content

Commit

Permalink
Merge pull request #110 from googlefonts/meta
Browse files Browse the repository at this point in the history
Roboto Condensed: update metadata
  • Loading branch information
m4rc1e authored Jul 24, 2023
2 parents 5830221 + 69269dc commit 8aa699a
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 18 deletions.
26 changes: 22 additions & 4 deletions scripts/instantiate_condensed.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
"3,3,1,1033": "Google:Roboto Condensed Regular:2016",
"4,3,1,1033": "Roboto Condensed Regular",
"6,3,1,1033": "RobotoCondensed-Regular",
"25,3,1,1033": "RobotoCondensed"
},
}

italic_instance = {
"attribs": {"usWidthClass": 5},
"attribs": {"usWidthClass": 5, "italicAngle": -12, "caretSlopeRise": 2048, "caretSlopeRun": 435},
"axes": {"wdth": 75},
"filename": "RobotoCondensed-Italic[wght].ttf",
"names": {
Expand All @@ -44,15 +45,31 @@ def update_fvar_instances(ttfont):
subfamily_id = instance.subfamilyNameID
post_id = instance.postscriptNameID
for record in name.names:
if record.nameID in [subfamily_id, post_id]:
if record.nameID in [subfamily_id]:
current_name = record.toUnicode()
new_name = current_name.replace("Condensed", "").strip()
name.setName(new_name, record.nameID, record.platformID, record.platEncID, record.langID)

if record.nameID in [post_id]:
current_name = record.toUnicode()
new_name = current_name.replace("-Condensed", "Condensed-").strip()
name.setName(new_name, record.nameID, record.platformID, record.platEncID, record.langID)

string = record.toUnicode()
name.setName(string.replace("Roboto-Condensed", "RobotoCondensed-"), record.nameID, record.platformID, record.platEncID, record.langID)


def update_stat(ttfont):
# Elide Condensed STAT AvisValue
stat = ttfont["STAT"].table
name_table = ttfont["name"]
axis_values = [a for a in stat.AxisValueArray.AxisValue]
for av in axis_values:
name_id = av.ValueNameID
name = name_table.getName(name_id, 3, 1, 0x409).toUnicode()
if name == "Condensed":
av.Flags = 2


vf_roman = TTFont(sys.argv[1])
vf_italic = TTFont(sys.argv[2])
out_dir = mkdir(sys.argv[3])
Expand All @@ -61,8 +78,9 @@ def update_fvar_instances(ttfont):
for inst, vf in zip([roman_instance, italic_instance], [vf_roman, vf_italic]):
print(f"Making {inst['filename']}")
instance = instantiateVariableFont(vf, inst["axes"])
# update_attribs(instance, **inst["attribs"])
update_attribs(instance, **inst["attribs"])
update_names(instance, rm_private=False, **inst["names"])
update_fvar_instances(instance)
update_stat(instance)
out_path = os.path.join(sys.argv[3], inst["filename"])
instance.save(out_path)
2 changes: 1 addition & 1 deletion scripts/regression_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ curl -s https://api.github.com/repos/googlefonts/roboto-classic/releases/latest
| cut -d ":" -f 2,3 \
| tr -d \"\, \
| wget -i -
unzip -po Roboto_*.zip "Roboto_v3.006/hinted/Roboto\[ital\,wdth\,wght\].ttf" > $OLD_FONT
unzip -po Roboto_*.zip "Roboto_v3.007/hinted/Roboto\[ital\,wdth\,wght\].ttf" > $OLD_FONT


# Diff old hinted variable font against current
Expand Down
2 changes: 1 addition & 1 deletion sources/Roboto-Black.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/Roboto-BlackItalic.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/Roboto-Italic.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/Roboto-Regular.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/Roboto-Thin.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/Roboto-ThinItalic.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-Bold.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-BoldItalic.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-Italic.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-Light.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-LightItalic.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-Regular.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
<key>year</key>
Expand Down
2 changes: 1 addition & 1 deletion sources/RobotoCondensed-Thin.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<key>versionMajor</key>
<integer>3</integer>
<key>versionMinor</key>
<integer>7</integer>
<integer>8</integer>
<key>xHeight</key>
<integer>1082</integer>
</dict>
Expand Down

0 comments on commit 8aa699a

Please sign in to comment.