-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-fonts-4] Behavior for variable fonts with 'ital' axis ambiguous / underspec'ed #3125
Comments
The
The problem is that when it is used as a variation axis, it is not used for matching.
Currently, regardless of the value of the
The initial value for the font-style descriptor is
|
There are a few nuances to this that are worth noting. When using a variable font in two files (one containing upright characters, one containing italics), family grouping works perfectly in all browsers:
This results in every browser I've tested rendering the text correctly, calling the right font file and rendering the proper glyphs, so that
gets you the proper bolder weight;
gets you proper italics;
gets you the proper italics, set to the bolder value on the weight axis Where this breaks down is when you have a single variable font file that contains both upright and italics. It's worth noting here that from the type designers' (and OT spec creators') perspective, italics ('ital') is boolean (0 or 1, upright or italic), whereas slant ('slnt') is intended to be a range. And it's highly unlikely that you would have both italics and slant in the same design. If I understand it correctly, this is why it was implemented in Safari in this way (to use the degree range to indicate the presence of an italic axis). According to @litherum the correct syntax would be something like this:
where the resulting behavior would be that the browser would inspect the font and based on the presence of an italic axis, clamp Currently, if I use that syntax, everything works as @litherum describes. If I omit Of Note Proposed solution
for when you have upright and italics, and
for when a slant axis is present. References: And there's a CodePen of just the italics set up without the |
What needs to happen to move this forwards? :) |
@litherum the specification as written conflates the The MDN site to which @jpamental contributed takes a strong position:
Do we want to enforce that? (it is common, but not universal). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
(Sorry for not replying on this until now.) I can't really put replies inline, so I'll selectively pull quotes from above.
This has now shifted down to 11deg (though the exact value doesn't affect the argument at hand).
Right. The idea is that the
This is indeed the crux of the issue. When I designed this feature, I was assured that it was meaningless to say "0.5 ital", and that italics are, therefore, a boolean toggle. I did, however, neglect to handle the case where a font can support both values of the boolean toggle. I was also assured that it would be a Bad Thing™ to make it easy for an author to request both oblique and italics at the same time. I think this is an orthogonal concern, though, as it affects the grammar of the I think @jpamental's proposal makes sense, as it agrees with the spirit of making the We do have a choice, though, whether we want a font to be able to advertise that it supports both italics and obliques. Do any such fonts exist? If the answer is "yes," then this is probably the right grammar:
If the answer is "no," then this is probably the right grammar:
|
Is this still the case or has there been any progress on this issue? It's very strange not to be able to use Am I understanding this correctly? |
@litherum wrote:
It seems we need a good answer to that question, before designing a solution. |
Several years ago, @djrrb made a version of his Roslindale typeface where the italic axis is separate from the slant axis (which is used for You can also preview how it works with a live demo here: |
That Roslindale Variable Italic was tricky, because ideally I wanted I know it’s weird, but maybe also worth mentioning that I also wanted the Because of the technical limitations of It’s also worth mentioning @arrowtype’s Recursive does a similar thing, but uses a custom |
What if
(I don't think a case should be made for "normal 0.5" manipulating the 'ital' axis akin to "italic 0.5", although it could be specced like that — it is more natural to define an "amount of italicness" via the "italic" attribute, imo.) A variable font covering uprights, cursive forms triggered by "ital" and slanted italics covered by "slnt" could thus be used. It would even allow for gradual triggering of cursive forms using the specced ital range 0 to 1. The obvious inconsistency the two specs make regarding slant/oblique angle direction is already in existence, unfortunately. |
On Mastodon, @svgeesus asked for examples of real variable fonts that provide oblique and italic options independently. However, based on the discussion both here & there, it seems font designers are avoiding that for technical reasons, rather than design ones. So I started imagining a design that would include both. So here is my rough design spec (samples below), for a handwriting font family with two continuous variable axes: SLNT (slant angle) and CRSV (cursive style, from block print through connected cursive). I want easy access to six named instances: Normal, Oblique, Italic, Upright Italic, Cursive, and Upright Cursive. The slant angle for the named oblique style is different from the slant angle used in the named italic and cursive styles. I may or may not make masters for the higher slant angle in the cursive styles, but otherwise assume that both the change in slant angle and the change in cursive style are continuous between the shown samples. The variable font could also have other axes, like weight and width. My question: How should this be implemented in OpenType? How should the styles be accessed in CSS? Requirements:
Ideally (in my opinion):
|
@AmeliaBR Note that the VF spec allows arbitrary axes and convention is to uppercase those arbitrary tags (e.g. "CRSV"), as opposed to lower casing registered axes’ tags. A CSS spec should probably pertain only to registered axes and their ranges so Adapter would be one more variable font with both axes, albeit If simplification is the goal one could argue
(Mind you, font vendors can choose to implement axes in a way that they implicitly trigger another, so say a VF might be instructed to show If control is the goal, my suggestion from the previous post is applicable, at the expense of complexity. |
It was my original intent to use both |
We (I) asked you to do that because the behavior was underspecified, iirc. https://arrowtype.github.io/vf-slnt-test was also great work you did at that time :) |
@jpamental initially reported this issue discussing font matching and rendering results for a variable font that has an
ital
axis.I do not see a clear and interoperable way to make them work described by the spec:
Assume there is a font face declaration as follows:
for a font that has an 'ital' axis ranging from 0 to 1.
And a style rule as follows:
The font matching algorithm describes that after no match for
italic
is found, oblique 20deg and above should be tried next, so Font Face 1 is matched.However, as there is no way of specifying
font-style: italic 0 1
the@font-face
declaration and the actual font axes mismatch. The@font-face
declaration pretends to be able to apply aslnt
/ oblique axis varying between 0 and 20 to the font. However, the font does not have aslnt
axis.If we really do not want to have a way of specifying a way for italic (not oblique) to be variable, then I am missing a clarification in the spec that would say something about how
oblique <angle> <angle>
and a resulting matched instance / style likeoblique 20deg
should be applied asital 1
in terms of variation parameters to a font that does not have a realital
axis but instead is declared withoblique <angle> <angle>
.CC @behdad @kojii @jpamental
The text was updated successfully, but these errors were encountered: