Skip to content

Commit

Permalink
Merge pull request #372 from arrowtype/improve-code-metadata
Browse files Browse the repository at this point in the history
Bump fonts to v1.054 for updates in latest code-specific fonts
  • Loading branch information
arrowtype authored Aug 4, 2020
2 parents 88513e6 + 29123a1 commit c3c127d
Show file tree
Hide file tree
Showing 230 changed files with 75 additions and 52 deletions.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

Fonts in `Recursive_Desktop` and `Recursive_Code` are made so that it is possible to install all of these without experiencing conflicts in font menus. However, you may want to pick-and-choose which font files you wish to install, based on your needs.

## General Desktop use (Word, PowerPoint, Keynote, InDesign, Illustrator, PhotoShop, Figma, etc)
General rule: only install TTF *or* OTF files of a given font family.

## General Desktop use (Word, PowerPoint, Keynote, InDesign, Illustrator, PhotoShop, etc)

- On Windows, install `Recursive_Desktop/recursive-statics.ttc` (This is a collection of all 64 static instances in TTF format)
- On Mac, install `Recursive_Desktop/recursive-statics.otc` (This is a collection of all 64 static instances in OTF format)
Expand All @@ -11,3 +13,9 @@ Fonts in `Recursive_Desktop` and `Recursive_Code` are made so that it is possibl

- Install `Recursive_Desktop/Recursive_VF_1.0XX.ttf` (this is the full Recursive variable font)
- It may also be beneficial to install static fonts, as OS & app support of variable fonts is still growing

## Alternative to OTC/TTC, better for Figma app and for older systems

Some people prefer to instead install individual static fonts, and this works better in certain software currently, such as Figma (see https://github.com/arrowtype/recursive/issues/339).

For these cases, you can instead install fonts from `separate_OTF_TTF_statics`.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
107 changes: 58 additions & 49 deletions src/build-scripts/make-release/change-font-versions-in-dir.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
"""
A script to change the version of a font binary.
A script to change the version of a font binary.
For use on pre-prepped directory, e.g. `fonts_1.050`.
For use on pre-prepped directory, e.g. `fonts_1.050`.
→ Changes font versions in `head` and `name` tables
→ Updates version numbers in paths
→ Changes font versions in `head` and `name` tables
→ Updates version numbers in paths
Would have to handle OTC/TTC collections to work in entire release dir.
Would have to handle OTC/TTC collections to work in entire release dir.
USAGE:
python3 src/build-scripts/make-release/change-font-versions-in-dir.py <font_dir_path> <version>
...where <version> is a number in the format of "1.054"
"""

from fontTools.ttLib import TTFont
Expand All @@ -17,67 +23,70 @@
# GET / SET NAME HELPER FUNCTIONS

def getFontNameID(font, ID, platformID=3, platEncID=1):
name = str(font['name'].getName(ID, platformID, platEncID))
return name
name = str(font['name'].getName(ID, platformID, platEncID))
return name

def setFontNameID(font, ID, newName):
print(f"\n\t• name {ID}:")
macIDs = {"platformID": 3, "platEncID": 1, "langID": 0x409}
winIDs = {"platformID": 1, "platEncID": 0, "langID": 0x0}
print(f"\n\t• name {ID}:")
macIDs = {"platformID": 3, "platEncID": 1, "langID": 0x409}
winIDs = {"platformID": 1, "platEncID": 0, "langID": 0x0}

oldMacName = font['name'].getName(ID, *macIDs.values())
oldWinName = font['name'].getName(ID, *winIDs.values())
oldMacName = font['name'].getName(ID, *macIDs.values())
oldWinName = font['name'].getName(ID, *winIDs.values())

if oldMacName != newName:
print(f"\n\t\t Mac name was '{oldMacName}'")
font['name'].setName(newName, ID, *macIDs.values())
print(f"\n\t\t Mac name now '{newName}'")
if oldMacName != newName:
print(f"\n\t\t Mac name was '{oldMacName}'")
font['name'].setName(newName, ID, *macIDs.values())
print(f"\n\t\t Mac name now '{newName}'")

if oldWinName != newName:
print(f"\n\t\t Win name was '{oldWinName}'")
font['name'].setName(newName, ID, *winIDs.values())
print(f"\n\t\t Win name now '{newName}'")
if oldWinName != newName:
print(f"\n\t\t Win name was '{oldWinName}'")
font['name'].setName(newName, ID, *winIDs.values())
print(f"\n\t\t Win name now '{newName}'")

# MAIN FUNCTION

def changeVersion(fontPath, newVersion, savePath=None):
def changeVersion(fontPath, newVersion):
# def changeVersion(fontPath):
font = TTFont(fontPath)
font = TTFont(fontPath)

oldVersion = str(font['head'].fontRevision)[0:5]
oldVersion = str(font['head'].fontRevision)[0:5]
# oldVersion = "1.520" # if you need to replace a specific bad version number in the naming, set the old version string manually

print(oldVersion)
print(oldVersion)

font['head'].fontRevision = newVersion
font['head'].fontRevision = newVersion

# update name 3 – 1.050;ARRW;Recursive-SansLinearLight
oldName3 = getFontNameID(font, 3)
setFontNameID(font, 3, oldName3.replace(oldVersion, str(newVersion)))
# update name 3 – 1.050;ARRW;Recursive-SansLinearLight
oldName3 = getFontNameID(font, 3)
setFontNameID(font, 3, oldName3.replace(oldVersion, str(newVersion)))

# update name 5 – Version 1.050
print(getFontNameID(font, 5))
oldName5 = getFontNameID(font, 5)
setFontNameID(font, 5, oldName5.replace(f"Version {oldVersion}", f"Version {str(newVersion)}"))
# update name 5 – Version 1.050
print(getFontNameID(font, 5))
oldName5 = getFontNameID(font, 5)
setFontNameID(font, 5, oldName5.replace(f"Version {oldVersion}", f"Version {str(newVersion)}"))

if oldVersion != newVersion:
try:
font.save(savePath)
except:
font.save(fontPath)
print(f"Font version: {oldVersion}{newVersion}")
if oldVersion != newVersion:
# this logic is messed up ...
try:
savePath = fontPath.replace(str(oldVersion), str(newVersion))
font.save(savePath)
except:
savePath = fontPath.replace(str(oldVersion), str(newVersion))
font.save(fontPath)
print(f"Font version: {oldVersion}{newVersion}")

def changeVersionsInDir(directory, oldVersion, newVersion):
for root, dirs, files in os.walk(directory):
for file in files:
extension = file.split(".")[-1]
if extension in ["ttf","otf"]:
fontPath = os.path.join(root, file)
def changeVersionsInDir(directory, newVersion):
for root, dirs, files in os.walk(directory):
for file in files:
extension = file.split(".")[-1]
if extension in ["ttf","otf"]:
fontPath = os.path.join(root, file)

savePath = fontPath.replace(str(oldVersion), str(newVersion))
changeVersion(fontPath, newVersion, savePath)
changeVersion(fontPath, newVersion)


if __name__ == '__main__':
# fire.Fire(changeVersion)
fire.Fire(changeVersionsInDir)
# fire.Fire(changeVersion)
fire.Fire(changeVersionsInDir)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Fonts in `Recursive_Desktop` and `Recursive_Code` are made so that it is possible to install all of these without experiencing conflicts in font menus. However, you may want to pick-and-choose which font files you wish to install, based on your needs.

## General Desktop use (Word, PowerPoint, Keynote, InDesign, Illustrator, PhotoShop, Figma, etc)
## General Desktop use (Word, PowerPoint, Keynote, InDesign, Illustrator, PhotoShop, etc)

- On Windows, install `Recursive_Desktop/recursive-statics.ttc` (This is a collection of all 64 static instances in TTF format)
- On Mac, install `Recursive_Desktop/recursive-statics.otc` (This is a collection of all 64 static instances in OTF format)
Expand All @@ -11,3 +11,9 @@ Fonts in `Recursive_Desktop` and `Recursive_Code` are made so that it is possibl

- Install `Recursive_Desktop/Recursive_VF_1.0XX.ttf` (this is the full Recursive variable font)
- It may also be beneficial to install static fonts, as OS & app support of variable fonts is still growing

## Alternative to OTC/TTC, better for Figma app and for older systems

Some people prefer to instead install individual static fonts, and this works better in certain software currently, such as Figma (see https://github.com/arrowtype/recursive/issues/339).

For these cases, you can instead install fonts from `separate_OTF_TTF_statics`.
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Beta 1.053
1.054

0 comments on commit c3c127d

Please sign in to comment.