Closed
Bug 1452973
Opened 6 years ago
Closed 6 years ago
Update NS_FONT_STRETCH_* constants to percentage-based values in preparation for CSS Fonts 4
Categories
(Core :: Layout: Text and Fonts, enhancement)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
Currently, we use constants in the range [-4 .. 4] to represent the 9 possible font-stretch values from ultra-condensed to ultra-expanded. However, CSS Fonts 4 updates font-stretch to accept not just the 9 enumerated values, but any non-negative percentage value (with the enumerated values mapping to percentages from ultra-condensed at 50% to ultra-expanded at 200%). In preparation for this, I propose revising the constants to values based on the CSS Fonts 4 percentage definitions. This allows us to make the necessary changes to the font-matching algorithm, and to begin mapping font-stretch values to the 'wdth' axis in OpenType variation fonts. (At this point, I'm leaving the stretch fields in gfxFontStyle, gfxFontEntry, etc as integers, to minimize risk in this bug. The next step, when parsing is updated to accept floating-point percentage values in addition to the enumerated values, will be to switch to a floating- or fixed-point representation for all the affected font properties -- stretch, weight, style.)
Assignee | ||
Comment 1•6 years ago
|
||
This is mostly trivial: change the definitions in gfxFontConstants.h, and switch font-stretch fields/variables from signed to unsigned now that they're always non-negative. The only other thing is a minor update to the font-matching code where it's computing "distance" between styles based on the constants. Tryserver says this doesn't break anything (at least not anything too obvious): https://treeherder.mozilla.org/#/jobs?repo=try&revision=654b6927ba0dc7dcd308067bc727bd24b3c1ea3f.
Attachment #8966586 -
Flags: review?(jwatt)
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•6 years ago
|
||
Rebased this on top of the part-1 patch from bug 1436048.
Attachment #8967858 -
Flags: review?(jwatt)
Assignee | ||
Updated•6 years ago
|
Attachment #8966586 -
Attachment is obsolete: true
Attachment #8966586 -
Flags: review?(jwatt)
Comment 3•6 years ago
|
||
Comment on attachment 8967858 [details] [diff] [review] Update NS_FONT_STRETCH_* constants to values based on the percentage definitions in css fonts 4 Review of attachment 8967858 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/thebes/gfxDWriteCommon.h @@ +20,5 @@ > #include <windows.h> > #include <dwrite.h> > > static inline DWRITE_FONT_STRETCH > +DWriteFontStretchFromStretch(uint16_t aStretch) Might as well get rid of the trailing white space while you're here.
Attachment #8967858 -
Flags: review?(jwatt) → review+
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/8b14b0ba94db Update NS_FONT_STRETCH_* constants to values based on the percentage definitions in css fonts 4. r=jwatt
Comment 5•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8b14b0ba94db
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•