Skip to content

Make formatVersion in metainfo.plist a major/minor #78

Closed

Description

@typesupply

We have switched to an incremental approach to updating the spec rather than holding lots of changes until a major version bump. To make it easier for readers to more easily identify these new format UFOs we need to make the formatVersion in metainfo.plist a float instead of an int.

Activity

  1. justvanrossum commented on Jan 8, 2019

    @justvanrossum
    Contributor

    Suggest to only ever to increment by 0.1, and not go over 3.9. After that 4.0 is inevitable and then we should change the format specifier in metainfo.plist.

  2. anthrotype commented on Nov 1, 2019

    @anthrotype
    Member

    What about, instead of changing the type of the existing formatVersion element from int to float (which would break existing implementation), we add an additional int element <formatVersionMinor> which defines the minor version, and the existing <formatVersion> continues to define (implicitly) the major version?
    This way existing clients will (with all probability) ignore the extra element (unless they are overly strict in their validation), while updated clients will be able to read the new formatVersionMinor element and act accordingly.

    We could settle on a versioning policy whereby we only ever change the major version when: 1) we remove support for existing pieces of data; or 2) change their semantics in a breaking way. Whereas we would bump the minor version every time we add extra elements or attributes to existing elements or define new public. lib keys or add whole new files to the UFO package.

  3. anthrotype commented on Nov 1, 2019

    @anthrotype
    Member

    (maybe formatMinorVersion reads better in English than formatVersionMinor)

  4. anthrotype commented on Nov 1, 2019

    @anthrotype
    Member

    Alternatively, we would be forced to bump the formatVersion directly to 4.0, that is bump the major version because we changed the type of formatVersion element itself from int to float.

  5. typesupply commented on Nov 1, 2019

    @typesupply
    ContributorAuthor

    I like the formatVersionMinor idea. We have a versionMinor field in fontinfo.plist so I'm fine with the awkward order.

  6. benkiel commented on Nov 1, 2019

    @benkiel
    Contributor

    +1

  7. anthrotype commented on Nov 20, 2019

    @anthrotype
    Member

    OK, I'll work on fontTools.ufoLib support for parsing a new optional formatVersionMinor element in metainfo.plist.
    But what about the GLIF format attribute? Do we want to add a new optional formatMinor attribute? Or do we re-purpose the existing format attribute to be a dot-separated "minor.major" string?
    XML attributes (unlike plist) do not have an intrinsic type, they're just strings.
    I am leaning towards simply doing format="2.1", instead of adding new formatMinor for GLIF.

    WDYT?

  8. benkiel commented on Nov 21, 2019

    @benkiel
    Contributor

    That sounds like the simplest thing

  9. anthrotype commented on Nov 21, 2019

    @anthrotype
    Member

    Hm. However the whole point of defining an additional minor version was to avoid breaking existing tools, since the new features are meant to be additive. If we change the meaning of GLIF format attribute from an integer to a dotted version string, then existing tool will break (e.g. you won't be able to read a UFO 3.1 with GLIF 2.1 in an editor that only supports up to UFO3/GLIF2).
    Older versions of fontTools.ufoLib, to take one, will refuse to load such GLIF 2.1 with "Unsupported format version" because it casts to int() and check if it's in (1, 2).

  10. anthrotype commented on Nov 21, 2019

    @anthrotype
    Member
  11. benkiel commented on Nov 21, 2019

    @benkiel
    Contributor

    @anthrotype You've just argued against your earlier lean; but this raises a really good point. Based on that, I would think the thing to do is to also add formatMinor to GLIF, keeping format for the major format. Nothing will break then.

  12. justvanrossum commented on Dec 13, 2019

    @justvanrossum
    Contributor

    Should we consider bumping the major version to 4 after all, but keep the amount of spec changes low, to increase the chance that it will be adopted soon?

  13. anthrotype commented on Dec 13, 2019

    @anthrotype
    Member

    I think adding a extra formatMinorVersion (and formatVersion attribute in GLIF) would give lend us more flexibility in the future for adding non-breaking-changes stuff like the verticalOrigin.
    The way I'm implementing them in ufoLib is so that a UFO 3.1 will still be read in by older versions with its additional data (silently) ignored. I think this is better than the font being completely rejected as invalid, especially for things like the verticalOrigin or height which are relatively less common in predominantly horizontal-scripts-centric font develpment workflows.

  14. justvanrossum commented on Dec 13, 2019

    @justvanrossum
    Contributor

    more flexibility in the future

    Oh, that is beyond doubt.

    If you think we can pull off a 3.1 without breakage that would be awesome.

    (glyph.height returning None instead of 0 would be a breaking change, though, no? #95)

  15. anthrotype commented on Dec 13, 2019

    @anthrotype
    Member

    (glyph.height returning None instead of 0 would be a breaking change, though, no?)

    hm, you got me there.. 🤔
    The current behavior of glifLib is to not write a height attribute when the glyph.height value is 0.
    Whereas the new glifLib would not write the height attribute when getattr(glyph, "height", None) is None.
    So if one reads a new GLIF 2.1 using the old glifLib, then an omitted height attribute would be mistaken for a height of 0. That's not good, but..
    Conversely if one reads an old GLIF 2.0 using the new glifLib updated to support formatMinor and new optional-height-default, then we could decide to do two things when faced with an omitted height attribute:

    1. either we interpret this as an implicit height = 0 (but then as we save the UFO with the latest format all the glyphs will end up with an additional explicit height set to 0; maybe not too bad); or
    2. intepreted as (incorrectly) meaning that the default height (asc - desc) is not overridden by this particular glyph and be unset to None.

    Ah, another thing. Since these proposed changes to verticalOrigin and glyph height only concern the GLIF file and not the rest of the UFO files or structure, and given GLIF format has a version of its own, I think it would make more sense to only increment the GLIF format version (from 2 to 2.1) and not also the UFO format version which could stay 3 (err 3.0, formatVersion=3 and implicit formatVersionMinor=0 in the metainfo.plist).

  16. 9 remaining items

  17. alerque commented on Aug 12, 2020

    @alerque

    Is it too late to revisit this? I don't think float makes any sense for version numbers and is just going to confuse the issue and make other things hard down the road. Floats just aren't good for versioning. Using a major/minor or even major/minor/patch versioning scheme would be awesome (ala Semver) but a float just confuses the issue. It won't be backwards compatible, it will look like a mathematical value but you won't be able to do normal math (x < y) on it, etc. Of course the other option is to just stick with integers. If introducing a breaking change from 3 to 3.1 is somehow okay (i.e. an existing field that needs parsing as a different type) then just calling it 4 and not being afraid to run up the integer count is probably a better plan.

  18. justvanrossum commented on Aug 12, 2020

    @justvanrossum
    Contributor

    Check ufoLib: it has not been implemented as a float, but as major/minor.

  19. benkiel commented on Aug 12, 2020

    @benkiel
    Contributor

    I'll write doc for this. Will do this weekend.

  20. self-assigned this
    on Aug 12, 2020
  21. benkiel commented on Aug 12, 2020

    @benkiel
    Contributor

    And, this should be in 3.1.

  22. typesupply commented on Aug 12, 2020

    @typesupply
    ContributorAuthor

    I've been working on documenting the specification process and "what version of the spec should this proposal apply to?" is near the top of the page. We have two models for that now:

    1. A change that would trigger code changes in existing tools goes to the next major version.
    2. A change that can be implemented via a lib key goes to the current version.

    Where would the minor version fit into this? Is it a hint to tools that "this UFO was last touched by a tool that knows about X, Y, Z new things"? I'm just trying to figure out how to fit this into the process.

  23. benkiel commented on Aug 12, 2020

    @benkiel
    Contributor

    I think that @anthrotype will have a better nuanced view than I, but i would say that minor versions are for things that won't break existing tools but add information, such as the addition of version minor (yes, this is recursive). Additions to fontinfo would fall under this too, at least in my mind.

  24. typesupply commented on Aug 12, 2020

    @typesupply
    ContributorAuthor

    i would say that minor versions are for things that won't break existing tools but add information, such as the addition of version minor (yes, this is recursive).

    Makes sense. I'll work this into the process.

    Additions to fontinfo would fall under this too, at least in my mind.

    Cool. That relates to #128.

  25. changed the title [-]Make formatVersion in metainfo.plist a float.[/-] [+]Make formatVersion in metainfo.plist a versionMajor.versionMinor[/+] on Aug 16, 2020
  26. changed the title [-]Make formatVersion in metainfo.plist a versionMajor.versionMinor[/-] [+]Make formatVersion in metainfo.plist a major/minor[/+] on Aug 16, 2020
  27. added a commit that references this issue on May 11, 2026
  28. added a commit that references this issue on May 14, 2026
  29. added a commit that references this issue on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

approvedApproved specification change.proposalProposed specification change.ufo3UFO 3 issues.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions