attempt to fix static font name linking metadata stuff, re #519 and #515

This commit is contained in:
Rasmus Andersson 2023-04-21 17:45:54 -07:00
parent 0e3f6d91ab
commit b4d529e2d1
3 changed files with 168 additions and 13 deletions

View file

@ -27,7 +27,21 @@ def update_version(ufo):
ufo.info.openTypeNameVersion = "Version %d.%03d;git-%s" % (versionMajor, versionMinor, buildtag)
psFamily = re.sub(r'\s', '', ufo.info.familyName)
psStyle = re.sub(r'\s', '', ufo.info.styleName)
ufo.info.openTypeNameUniqueID = "%s-%s:%d:%s" % (psFamily, psStyle, now.year, buildtag)
#
# id format:
# version ";" "git-" git-tag ";" foundry-tag ";" ps_family "-" ps_style
# E.g.
# "4.001;git-4de559246;RSMS;Inter-DisplayThinItalic"
# Note: this should match what generated by fontmake.
# fix-static-display-names.py depends on this format being consistent for all fonts.
#
if buildtag != "src":
buildtag = "git-" + buildtag
ufo.info.openTypeNameUniqueID = "%d.%03d;%s;%s;%s-%s" % (
versionMajor, versionMinor,
buildtag,
ufo.info.openTypeOS2VendorID,
psFamily, psStyle)
ufo.info.openTypeHeadCreated = now.strftime("%Y/%m/%d %H:%M:%S")