OpenType comes to CSS3

joeclark's picture

Nobody else seems to have posted this, so I will: The current CSS3 Fonts Module provides a syntax to use CSS to declare use of a few dozen OpenType properties. If I have the list correct, they are:

  1. afrc
  2. calt, clig
  3. calt, clig
  4. cswh
  5. dlig
  6. dlig
  7. frac
  8. fwid
  9. hist
  10. hlig
  11. hlig
  12. hojo
  13. jp04
  14. jp78
  15. jp83
  16. jp90
  17. liga
  18. liga
  19. lnum
  20. nalt
  21. nlck
  22. onum
  23. ornm
  24. pcap
  25. pnum
  26. pwid
  27. ruby
  28. salt
  29. smcp
  30. smpl
  31. ss
  32. swsh
  33. titl
  34. tnam
  35. tnum
  36. trad
  37. unic
  38. zero

Remember: This is merely a proposal. CSS3 has been broken into modules so that that makers of browsers (etc.) can pick and choose which modules to support rather than being offered a package deal of every single CSS feature, which, experience proves, is too much to handle at once. (Hence it is impossible to state that a browser “supports CSS3.”)

Nonetheless, this is surely a useful development. The acknowledgements on the page will reveal a few Usual Suspects.

penn's picture

Thanks for this list — I've been wondering about using Opentype features in CSS. Could you point to or provide a few code snippets demonstrating the use of these properties?

John Hudson's picture

It's worth noting that the typography properties themselves are at a higher level than the OTL features, i.e. the latter represent one possible way of implementing a CSS3 typography property; the same property could also be implemented with equivalent e.g. AAT or Graphite features.

I note that there doesn't seem to be support for caps as smallcaps (OTL=c2sc), which is a problem. This is probably a distinction that needs to be made at the caps-value level. [The same is true for caps as petite-caps, of course.]

joeclark's picture

Yes, the CSS properties merely correspond to OpenType. They could correspond to other implementations. In practice, will they, though?

Now, since I’m one of those people who does not sit down to read the OpenType specification over coffee, which is odd because I have done exactly that with many other specifications, do please explain, John, if c2sc means “every single letter becomes small caps, whether originally capitalized or not.”

pers0n's picture

Do you know if they will get the number weights to correspond to fonts?

example:
font-weight:300;

You know how they have 100, 200, 300, ..., 900

Then again I'm not sure what the fonts have to do, to be able to do that. Would be interesting to find out.

John Hudson's picture

Joe, c2sc converts uppercase letters (and potentially lining figures and some punctuation) to smallcaps, and smcp converts lowercase letters to smallcaps. Practically, c2sc isn't expected to be applied independently of smcp, so I would expect the CSS3 caps-value to have options similar to InDesign's smallcaps (smcp) and all-to-smallcaps (c2sc+smcp) distinction.

Syndicate content Syndicate content