microsoft / OpenType-XVAR-proposal

Proposal for adding an XVAR table to OpenType Font Variations
Creative Commons Attribution 4.0 International
3 stars 5 forks source link

Synthetic axis dependencies with parametric axes #3

Open robmck-ms opened 6 years ago

robmck-ms commented 6 years ago

As mentioned in the README, there may be a problem with the dependency between synthetic axes and parametric axis coordinates used to synthesize the axis.

In his presentation at TypeParis 2018, David Berlow pointed out a problem with synthetic axes. In his parametric system, XTRA, YTLC, XOPQ, and YOPQ axis coordinates are objective measures of stem or counter weights per mille of UPM*. They actually measure something tangible in the font. You could build a synthetic axis optical size (opsz) axis out of these. For your 12pt opsz, you'd have a specific set of values of the parametric axes for that size, and for 24pt, you'd have a different set of values. Here's the trouble: if you start with that 12pt, then change only the coordinate of opsz to 24pt, you'll get the right rendering, but the coordinates for the parametric axes will be the same (because we didn't change them). Thus, the value of those parametric axes will not be accurate to the outlines (because within the font in XVAR, they've been remapped), thus these objective measures are now relative measures without an explicit reference outside the font to what they are relative to.

robmck-ms commented 6 years ago

One could make the dependency explicit, such that moving the synthetic axis causes an explicit change in the other coordinates. However this isn't implementable in existing frameworks: The HTML/CSS document model assumes that document properties are completely independent from each other. Most text layout APIs in operating systems I know of would also need a completely different model to give feedback back to apps, and it would be a lot of extra work on the app's side (with no functionality gain for them), so very unlikely to get implemented even if the API supported it. (Consider how many apps have great support for stylistic sets and other long-existing OpenType features).

be5invis commented 6 years ago

If #1 is included then an easy solution could be made:

behdad commented 6 years ago
  • Include both synthetic axes (like opsz) and parametric axes (like XTRA).
  • Mark parametric axes as pure internal (therefore external apps would always keep them zero).
  • In XVAR, write functions to compute parametric axes from optical axes. That is, you write function s to compute parameters from opticals.
  • In other tables (like gvar, respond to parametric axes only).

Exactly. The mapping, might decide to add the value of 'XTRA' to the computed 'XTRA', for tweaking it further by the user.

robmck-ms commented 6 years ago

Thinking about it a bit, I don't think the idea in #1 would make a good solution:

Side note: i'm not sure I understand the idea of deriving the parametric axes from optical axes. One of the major points of parametric axes is to have a set of axes that are truly orthogonal (optical axes aren't), so that it is easier to create optical axes. (The other major point is having a more objective scale for controlling type design parameters, if one wanted to build automation to do that).

be5invis commented 6 years ago

@robmck-ms The idea of pure internal axes is that this axis would NEVER be set by user or application. It could only be set by XVAR. If you want the controllability of both opsz and YTRA, you can add another pure internal axis and assign it with XVAR, using a formula taking opsz and YTRA.

robmck-ms commented 6 years ago

If they're never to be used by user or application, we shouldn't enumerate them. A flag would be a quick way to do this, but there's a question of what past operating systems would do - would they correctly not enumerate them?

Another implementation would be to put the internal axes in another table than fvar, but I just realized that would require a major overhaul of the specs: all the *var tables have an axisCount that refers to, and must agree with, fvar. So, fvar is the only place we can declare axes.