My fonts of choice usually default to text figures
which is one reason I like them. However, for tables or headings I'd like to specify that lining figures should be used:
Is there a way to do so in CSS?
(To appease the search:
The text-transform property is used to control the case of letters in text.
CSS Fonts is a module of CSS that defines font-related properties and how font resources are loaded. It lets you define the style of a font, such as its family, size and weight, line height, and the glyph variants to use when multiple are available for a single character.
Firefox 4.0 has basic text figure support. Here's how to turn on text (old-style) figures:
.text-figures {
-moz-font-feature-settings: "onum=1";
}
Looks like there's a set of css3 properties, such as font-variant-numeric, to control common properties. These are not yet supported by any browser, as far as I know.
Here's a jsFiddle where you can play around with the styles. It toggles between lining and old-style figures. I'm using Minion Pro on Windows 7, so you might have to find your own supported font on other platforms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With