Open Bug 1465026 Opened 6 years ago Updated 2 years ago

Font editor: values should be rounded

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: mbalfanz, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached video accurate-values.mp4
Sometimes, fields that have valid values are marked as red. When the sliders are then used, the resulting values have an unusable amount of decimals.

STR:
1. Go to v-fonts.com
2. Search for the font "Skia" (last on page) and inspect it
3. Adjust the axis

Expected result:
- Sliders are not marked in red as initial values are valid
- When sliders are moved, the set values have a usable accuracy (like 2)

Actual result:
- Initial values are marked with red border, even though "1" is a valid value
- When moving the sliders, it fills 15 decimals even though only the first 2 are actually changed
Actually, I noticed another problem with this:

Apparently Skia supports font-weight values of 0.48 - 3.2. This range doesn't make much sense (and yields the wrong results) as a value of the font-weight property, and should probably stay within font-variation-settings.

For width, it's equally confusing (and potentially wrong, as font-stretch expects percentages).
As Skia is a system font on OS X, here is a simple test case regarding the last comment:

data:text/html,<style>body{font-family: Skia}</style><p>Lorem ipsum

The font accepts the font-weight property with values in the hundreds (400, 600 etc.)

However, the variable weight axis expects of 0.48 - 3.2
The editor writes those values to font-weight, and therefore giving the unexpected result.
Skia is a legacy macOS font where the scales used for the "width" and "weight" axes are quite different from the CSS font-weight/font-stretch scales. Within the platform code, we don't attempt to map the high-level properties (width, stretch) to the variation axes in a font like this; the variations can only be managed directly via font-variation-settings.
Assignee: nobody → rcaliman
Status: NEW → ASSIGNED
Product: Firefox → DevTools
Assignee: rcaliman → nobody
Status: ASSIGNED → NEW
Summary: Values should be rounded → Font editor: values should be rounded
Blocks: 1280059
No longer blocks: 1441576
Carried over from Bug 1489479: limit precision to three decimals.
Component: Inspector: Fonts → Inspector
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: