godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.69k stars 20.11k forks source link

FontVariation variable font axes have two "default" values #93978

Closed e-dog closed 1 month ago

e-dog commented 2 months ago

Tested versions

System information

Godot v4.3.beta2 - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce GTX 1660 (NVIDIA; 31.0.15.3623) - Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz (4 Threads)

Issue description

FontVariation's variation coordinate "weight" displays default value of 100, while the actual value used for that axis is 400.

If set manually to 100 or 400, the displayed value resets to 100 displayed, and 400 actually used. If set to other values, like 101, 399, or 401, the displayed value persists and is used correctly for the font. This makes it impossible to set font weight to exactly 100.

The same is true for other axes, for example, "width" displays default value 62, but actually uses 100.

Steps to reproduce

  1. Create or select a FontVariation resource. Make sure "Base Font" is set to a variable font.
  2. In the Inspector, click to open "Variation" roll-out.
  3. Click on "OpenType - Variation Coordinates" right side to access variation axes / coordinates list.
  4. Observe default value of 100 for "Weight".
    • Optionally, use the font somewhere, and observe the actual used weight of 400 (regular).
  5. Change "Weight" value to 400.
  6. Click on "Variation Coordinates" two times to close and re-open the list of variation axes.
  7. Observe that "Weight" value changed to default 100 after re-opening the list, but Variation Coordinates are marked as changed.
    • Optionally, use the font somewhere, and observe the actual used weight of 400 (regular).
  8. Change "Weight" value to anything other than 100 or 400, for example: 101, 399, 401, 700, 900.
  9. Close and re-open the list, and observe that the changed value is NOT reset to the default 100.
    • Optionally, use the font somewhere, and observe that the actual used weight is consistent with the inspector's setting.

Minimal reproduction project (MRP)

FontVariationBug.zip

bruvzg commented 2 months ago

Should be fixed by #93957

AThousandShips commented 1 month ago

Can someone confirm this is fixed?

Calinou commented 1 month ago

Can someone confirm this is fixed?

I can confirm this is fixed as of 4.3.rc e343dbbcc (tested with the Inter Variable font from its official website).