[go: nahoru, domu]

Skip to content
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] font-size Descriptor for ex Unit #731

Open
Crissov opened this issue Nov 17, 2016 · 4 comments
Open

[css-fonts] font-size Descriptor for ex Unit #731

Crissov opened this issue Nov 17, 2016 · 4 comments

Comments

@Crissov
Copy link
Contributor
Crissov commented Nov 17, 2016

There currently is no font-size descriptor for use in @font-face. I propose it be added to manually specify the x-height and hence determine a non-fallback size (i.e. 0.5em) of the ex unit, which would be more useful and intuitive than the font-size-adjust property. If cap was added as a unit for the height of capital letters #660, this descriptor should also be able to set it. I think it makes most sense to only allow percentages of 1em.

@font-face {
  font-family: foo; src: url(foo.woff); 
  font-size: 45% 90%; /* fallback/default = 50% 100% */
}
.foo {
  font-family: foo; 
  font-size: 20px;
  padding-top: 1ex; /* = 0.45em = 9px */
  padding-left: 1cap; /* = 0.9em = 18px */
}
@Crissov
Copy link
Contributor Author
Crissov commented Nov 22, 2016

It might make sense to als include tuning of the (usually horizontal) ch unit, which is proposed to be affected by font-size-adjust in #750. This may mean that the font-size descriptor should be split into a font-height and a font-width descriptor (or become a shorthand for those).

@litherum
Copy link
Contributor
litherum commented Mar 8, 2017

See also: #806

@svgeesus
Copy link
Contributor

This seems to be covered by the improvements to Relative sizing: the font-size-adjust property @Crissov do you agree?

@Crissov
Copy link
Contributor Author
Crissov commented Aug 20, 2021

Hm…

Above, I proposed to specify, in a descriptor, a fallback ratio for ex as a percentage of em if the actual first available font value is not available. The newly extended font-size-adjust property value syntax still requires the actual value to be available when <number> is used and, of course, also when from-font is used instead.

In conclusion, I agree that this looks very similar, but could actually work in combination: the descriptor would provide a fallback value for m′, while the property specifies m.

PS: If a descriptor was added, the correct answer to #6384 could be affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants