font-patcher: Set SFNT Version

[why]
The Nerd Font Version is not added to the SFNT Version.
This is also a TODO item in `font-patcher`.
The SFNT-Revision is not updated at all.

[how]
Set the SFNT Version and Revision.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2021-11-29 10:04:40 +01:00
parent ab6fa3c562
commit 0d905e2293

View file

@ -401,12 +401,13 @@ class font_patcher:
self.sourceFont.comment = projectInfo self.sourceFont.comment = projectInfo
self.sourceFont.fontlog = projectInfo self.sourceFont.fontlog = projectInfo
# TODO version not being set for all font types (e.g. ttf)
# print("Version was {}".format(sourceFont.version)) # print("Version was {}".format(sourceFont.version))
if self.sourceFont.version != None: if self.sourceFont.version != None:
self.sourceFont.version += ";" + projectName + " " + version self.sourceFont.version += ";" + projectName + " " + version
else: else:
self.sourceFont.version = str(self.sourceFont.cidversion) + ";" + projectName + " " + version self.sourceFont.version = str(self.sourceFont.cidversion) + ";" + projectName + " " + version
self.sourceFont.sfntRevision = None # Auto-set (refreshed) by fontforge
self.sourceFont.appendSFNTName(str('English (US)'), str('Version'), "Version " + self.sourceFont.version)
# print("Version now is {}".format(sourceFont.version)) # print("Version now is {}".format(sourceFont.version))