Repository navigation
[css-fonts] font-synthesis-style is too blunt #9390
Description
(this is a follow up from #8914 (comment))
The main use case for font-synthesis-style: none is to be used in conjunction with font-style: italic, when the author does not want to get a oblique font as a fallback.
However, while it generally works for that purpose, it does a little too much, and a little not enough:
- if there is a non-synthetic oblique font face, is will be used as a fallback from italic regardless
font-synthesis-style. This is unlikely to be what the author want. font-synthesis-style: nonealso turns off the fallback fromfont-style: obliqueto synthetic oblique. This might be desired in some cases where the author is extremely picky, but unlike with italic, which is a distinctive style, synthetic oblique fonts are often close to indistinguishable from non-synthetic ones.
What we have is a system where, if italic is missing, we always fall back to oblique, but within oblique, we can turn off synthesis, regardless of whether oblique was specifically requested or is being used as a fallback.
What I think we need is a system where if italic is missing, authors can chose whether to fall back to oblique or not, and if yes, synthetic oblique is always acceptable when non-synthetic oblique is not available. Also, we might want an ability to turn off synthetic oblique when font-style: oblique has been requested, though I doubt there's much demand for that.
Even though I'd probably name such a switch differently if we were doing it from scratch, for compat reasons, I'd suggest repurposing the existing font-synthesis-style: none to become this request not to fallback from italic to oblique. That's what it's being used for anyway.
If we do need the extra switch for turning off synthetic oblique when font-style: oblique has been requested, I'd suggest expanding the syntax of that property to font-synthesis-style: auto | none || no-oblique or some such.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsUnsorted regular
- StatusShow more project fieldsThursday morning
Activity
svgeesus commentedon Sep 22, 2023
Yes, but we also need to take into account the case where a variable font oblique is available, but the range does not encompass the requested angle and we don't want to synthetic-oblique the already-obliqued face to get that value:
svgeesus commentedon Mar 14, 2024
@frivoal any thoughts on the intersection of your proposal and the need to not use outside-variable-range values?
@drott @jfkthame comments on the proposed change would be welcome
(@astearns removing too-eager Agenda+as there has been insufficient discussion to take it to a call)
frivoal commentedon Mar 15, 2024
I'd include that in as part of the behavior of the value that turns off the generation of synthetic oblique.
jfkthame commentedon Apr 6, 2024
I think I'd agree that
font-synthesis-style: noneshould disable fallback from italic to oblique, whether "real" or synthetic. It should also disable synthesis of oblique angles outside the available range supported by the font.(So if no oblique face is available, and font-synthesis-style is turned off,
font-style: obliquewill have no effect.)drott commentedon Apr 11, 2024
Generally, I am not sure how urgent of an issue this is, if authors control the content, they can control that just with providing the right web fonts, attributing the web fonts with the correct
font-style:descriptors and settingfont-synthesis-style: none;and then using either onlyitalicorobliquefor styling. I have not seen more than one font family (and that was a test font) that both has an oblique and an italic style.I am not in favor of re-purposing font-synthesis-x: for influencing font matching, I find that an architecturally strange side effect of a property. Fallback is not the same as synthesis. In that case, I'd rather see us make a choice and change the font matching algorithm to not perform fallback from italic to oblique, even if that's a breaking change. Perhaps we can assess the impact of that.
Agree that font-synthesis: none should not add slant when the variable axis range is exhausted - but I think that's already spec'ed.
[-][css-font] font-synthesis-style is too blunt[/-][+][css-fonts] font-synthesis-style is too blunt[/+]emilio commentedon Jan 29, 2025
So @frivoal mentioned that you might want oblique synthesis but no italic -> oblique fallback. So maybe
font-synthesis-style: auto | none | oblique-onlyor so?css-meeting-bot commentedon Jan 30, 2025
The CSS Working Group just discussed
[css-fonts] font-synthesis-style is too blunt, and agreed to the following:RESOLVED: Add oblique-only to font-synthesis-style, which synthesizes oblique but prevents using oblique as italic fallback.The full IRC log of that discussion
<TabAtkins> florian: font-synthesis-style isn't quite doing what most poeple want to use it for (i claim)<TabAtkins> florian: general notion is that some of the time, when you say italic, you kinda just mean "slanted", and italic is a pretty type of slanted
<TabAtkins> florian: if it's not there, you're okay with oblique, which is the normal letter shape but slanted, rather than a different letter shape
<TabAtkins> florian: but sometimes you really want to insist on italic and not fall back to oblique
<TabAtkins> florian: we say to use font-synthesis-style for that, but it doesn't work
<TabAtkins> florian: as currnetly specified, if you ahve a non-synth'd oblique font, the system *will* fall back to oblique even if you say synthesis:none, which i argue is almost never what they want
<TabAtkins> florian: that's first problem
<TabAtkins> florian: a lesser problem is i think it's extremely rare for someone who's explicitly requested oblique to not want a synthesized oblique when a natural isn't available
<TabAtkins> florian: difference between synthesized and manual italic can be big, but between synthesized and real oblique is pretty small
<TabAtkins> florian: so rare to care much about the differnece
<TabAtkins> florian: so i think it shoudl be possible for authors to epxress "don't fall back from italic to oblique" and also "if you fall back from oblique, it's okay to synthesize"
<TabAtkins> florian: I think a solution for this is to just add some more values to font-synth-style. we already have auto and none
<TabAtkins> florian: maybe shoudl add no-oblique that prevents italic->oblique fallback
<TabAtkins> florian: arguably a bit weird since it's fallback rather than synth, but this property is kinda doing that
<ChrisL> q+
<TabAtkins> florian: alternative is to change 'none' to do the "right thing", and add a new keyword oblique-only, allowing synthesizing oblique but not synthesizing italic *from* oblique
<astearns> ack ChrisL
<TabAtkins> florian: so proposal is "auto | none | oblique-only", and people should be advised to use oblique-only
<TabAtkins> ChrisL: I agree with that last one, emilio also proposed that. i think it makes the most sense.
<TabAtkins> astearns: me too
<TabAtkins> astearns: so proposed is to add oblique-only to font-synth-style
<TabAtkins> ChrisL: can i explicitly ping jfkthame ?
<TabAtkins> jfkthame: I guess this is reasonable. Not sure how big of a need there really is.
<TabAtkins> jfkthame: if the properties call for italic and there's no italic face, and oblique-only, what's the user gonna get? Is that really what they want? I'm not sure it is.
<TabAtkins> jfkthame: I'm not opposed, but also not particualrly convinced it's a big deal.
<TabAtkins> florian: that's generally a problem with synth; if the font isn't there, and you've turned off synthesis, you don't get what you're asked for.
<astearns> s/Is that really/They get regular. Is that really/
<TabAtkins> florian: at the moment the way we give you "not what you asked for" is almost certainly not what you expect, in some cases.
<TabAtkins> astearns: so jonathan is not opposed. anyone need more discussion? objections?
<TabAtkins> RESOLVED: Add oblique-only to font-synthesis-style, which synthesizes oblique but prevents using oblique as italic fallback.
[css-fonts-4] Added oblique-only as a value of font-synthesis-style #…