-
Notifications
You must be signed in to change notification settings - Fork 21
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
No support for "dnom" and "numr" #5
Comments
Adding these breaks the test... 1) should not break perf budget I'm not well versed in testing... and would love to chat about it and your approach to compiling sometime |
Thanks so much for the PR! So basically the performance budget is so I don’t go overboard with adding every OpenType feature class to this module—or, at least, it’s not in the core. In this case, the test just checks if the module is within 1.75kb gzipped so that I ensure I am writing concise CSS. Could of concerns with this, it looks like that the Also, the .subs,
.sinf {
/* If it doesn’t support `font-variant` */
@supports not (font-variant-position: sub) {
font-feature-settings: "subs"; /* …use `font-feature-settings` */
@supports (font-feature-settings: "subs") { /* If it does support that…*/
font-size: 1em; /* Override the browser defaults for `<sub>` and `<sup>` */
vertical-align: baseline;
}
/* Since Safari lies and says it supports `font-feature-settings`, fix fallback subscript */
@supports (overflow: -webkit-marquee) and (justify-content: inherit) {
vertical-align: sub; /* Restore the browser default for `<sub>` and `<sup>` */
font-size: smaller;
}
}
/* Hopefully none of that is applicable, and we just use `font-variant` */
font-size: inherit;
font-variant-position: sub;
} Does that kind of make sense? I might need to write up a contributing guide that explains that more in depth. |
Oops thanks for that.. missed the sinfs.. |
I couldn't find a font-variant for dnom or numr... so i think the new revision is the only solution. |
I'm not setting font-size: 1em; /* Override the browser defaults for `<sub>` and `<sup>` ...etc*/ because the class doesn't have to be used with tags. ACTUALLY I would suggest you remove that from the prior examples because it is creating conflicts with the current font-size in my case. |
Okay, thanks. If you delete the Can you elabourate or open a separate issue for the |
right!.. working on an example and confirming faked dnom and numr. in the case of 1em for subs and sinf: |
I think I've set the fake heights appropriately.. but its difficult to say I have a agreed upon solution for the .numr—since I can't find a good definition online. Type design aside—the numr is dependent on the placement of the dnom.. and the highest we can set it is v-align super... so unless we want to adding in top or some other sort of placement thats the best we can do. |
Hey thanks for taking time to revise that. I iterated on that and I think this should work, which should be the same result as what you had, but should compile a bit smaller: .sinf,
.dnom,
.numr {
@supports (font-feature-settings: "sinf"), (font-feature-settings: "dnom"), (font-feature-settings: "numr") {
font-variant-position: normal;
vertical-align: baseline;
}
/* Since Safari lies and says it supports `font-feature-settings`, fix fallback subscript */
@supports (overflow: -webkit-marquee) and (justify-content: inherit) {
vertical-align: sub;
font-size: smaller;
}
}
.sinf {
font-feature-settings: "sinf";
}
.dnom {
font-feature-settings: "dnom" 1;
}
.numr {
font-feature-settings: "numr" 1;
} …unfortunately, that is causing me problems with Sass now, because they still have a bug parsing comma-separated queries or something. I will have to take a look at that. That said, I took a closer look at the OpenType spec and it has this part:
Source (I’m sure you checked that too, just trying to understand it better.) In this library, the CSS classes are the UI / API. So I’m wondering if |
I think there is a use case... Not to get too creative but showing the dnom in a type specimen is a simple enough case. Alternatively I could see people using a series of dnom or numr to style math equations. |
Plus I think frac only supports a very limited amount of combinations, dnom and numr are there for when frac falls short |
I think it would make sense to add these in..
The text was updated successfully, but these errors were encountered: