silnrsi / smith

font development, testing and release
Other
14 stars 5 forks source link

extract VERSION from ufo #49

Closed bobh0303 closed 4 years ago

bobh0303 commented 6 years ago

Per TM2018 discussion: for UFO-based font projects, VERSION should not be hard-coded in the wscript, but rather should be obtained from one of the UFOs. The resulting version should be applied to TTFs and WOFFs.

FTLS-385 and Font Workflow 200 Build

bobh0303 commented 6 years ago

TBD:

mhosken commented 6 years ago

Introducing getufoinfo(path_to_ufo) which reads the UFO and extracts useful information from it, setting variables in the wscript accordingly. The variables set are: VERSION and BUILDLABEL (which is always set even if the value is empty).

Applied in commit b82e6e0c

bobh0303 commented 6 years ago

I just tried this and had two problems. I set the following in Regular UFO lib.plist openTypeNameVersion = Version 1.026; Beta versionMajor = 1 versionMinor = 26

And I put the following in the wscript, above the style-iteration:

getufoinfo('source/' + FAMILY + '-Regular' + '.ufo')

(Note that the version in the Bold UFO was different than the Regular, but the resulting Bold ttf had the same version as the Regular ttf, so I am convinced that the getufoinfo did pull at least Major & Minor from the Regular UFO.)

The problems:

  1. In the built ttfs, the version string for the dev fonts were Version 1.026; dev-30cedfM and the release fonts Version 1.026 -- no sign of Beta
  2. The resulting zip files were Harmattan--dev-nnnnnnnn.zip and Harmattan-.zip -- no sign of the version.
mhosken commented 6 years ago

The core issue is fixed in that the parser was not handling the ; in the version string. It now allows it and outputs it.

There is currently no expectation that smith release will transfer the 'Beta' into the version string or release .zip filename. This would need further discussion to be changed.

mhosken commented 6 years ago

Hrmph. This is tricky. getufoinfo() needs to be called before a package is created, which happens pretty much whenever you make anything new like a font or ftmltest. So getufoinfo() should be the first function you call in your wscript. Unfortunately, I don't know how to delay needing things like BUILDLABEL until after getufoinfo() is called.

nrsiward commented 6 years ago

In reviewing our prior discussions, I think we decided there would be no semicolons in version strings.

The name table version string is text that can contain numbers, letters, and punctuation. We recommend that this string have three parts, separated by spaces, in the form "Version M.mpp extrainfo"

see http://silnrsi.github.io/FDBP/en-US/Versioning.html

also see https://docs.google.com/document/d/1yEp5F60gz1lO1la7p5XLgRsztQQiy8Ia736yVMlJEvM/edit#heading=h.ylsab0k5rrm5

nrsiward commented 6 years ago

As far as I can tell, we did decide that the "Beta" would go in the file name for development builds.

VERSION = Release version string e.g. "x.yyy alpha2" BUILD_VERSION = Build version string e.g. git sha, but with no identifying adornment For a development build and if BUILD_VERSION is not blank: .zip and .exe archive filename is fontname-VERSION-dev-BUILD_VERSION

see https://docs.google.com/document/d/1bPqyTtfxBm2tmX1gPmJABpqX0djN-aF_YZPfVtuCIrg/edit#heading=h.sk9axvep5mr6

and https://docs.google.com/document/d/1yEp5F60gz1lO1la7p5XLgRsztQQiy8Ia736yVMlJEvM/edit#heading=h.kke4ew4l4cob

nrsiward commented 4 years ago

We decided that there will no longer be semicolons in the version string. ttfsetver will have an option added so that no semicolon is placed between the version number and description. Smith will be modified to use the option when calling ttfsetver

nrsiward commented 4 years ago

Currently release builds (where version=VERSION for the Font object) do not contain the BUILDLABEL (e.g. 'beta1') in the font version or the zip file name. Development builds do contain it prepended to the SHA (returned by getversion()). We decided this is acceptable pending testing that this behavior can be overridden for development builds by setting BUILDVERSION=BUILDLABEL in the wscript to support a build that contains the BUILDLABEL with no SHA in the version string and zip file name.

bobh0303 commented 4 years ago

All now documented in Workflow 110 Font Metadata, section About Alpha and Beta releases.