Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Can an internal axis have a normalized range between -1.0 and +1.0, or are we tied to 0.0 and 1.0? #3

Open
justvanrossum opened this issue Dec 9, 2020 · 4 comments

Comments

@justvanrossum
Copy link
Contributor

How does our design of reusable axes affect the normalized range of an axis, and does it matter?

Normalized axis values are between -1.0 and +1.0, but can be limited based on the fvar user values:

  • if min < default < max, then the range is -1.0 to +1.0
  • if min == default and default < max, then the range is 0.0 to +1.0
  • if min < default and default == max, then the range is -1.0 to 0.0

At the VarC level, we don't deal with user coordinates anymore, but we may need to specify how to clamp interpolated designspace coordinates.

@justvanrossum
Copy link
Contributor Author

We could require that fonts themselves should make sure that the interpolated local designspace values cannot be out of bounds, but that feels a bit wrong.

@justvanrossum
Copy link
Contributor Author

Perhaps clamping between -1.0 and +1.0 is good enough, even for axes that don't go below 0.

varLib behaves correctly with such clamping (it simply doesn't apply a delta if the scalar is not between 0 and 1, or something to that effect).

@behdad
Copy link

behdad commented Aug 22, 2022

Perhaps clamping between -1.0 and +1.0 is good enough, even for axes that don't go below 0.

That's what I do in avar2 proposal, clamp to -1..+1.

@Lorp
Copy link

Lorp commented Aug 22, 2022

I raised this issue in respect of avar2. In that case, the only practical disadvantage of sticking to a simple -1..+1 seems to be that a polyfill would not be able to generate all the possibilities that the font is capable of in an avar2 environment. That doesn’t seem like a reason to forbid fonts that exploit the technique.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants