Settings

Theme

In defense of webfonts

robinrendle.com

4 points by sdabdoub 10 years ago · 1 comment

Reader

Jaruzel 10 years ago

I recently discovered that the 'src' attribute of the @fontface directive supports the inline 'data:' syntax (like you can do with images etc.).

So you can basically do this:

  @fontface {
    ...
    src: url("data:font/opentype;base64,<base64-encoded-otf/ttf-file>");
  }
Although this expands the payload size slightly, it does remove the need for another round trip to a server (so renders potentially faster), and also gives you full control over your embedded fonts.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection