不明觉厉 发表于 2016-11-30 03:42:33
Over the past couple of weeks there’s been a lot ofexcitement over color fonts. Adobe describes the technology like this :
您需要 登录 才可以下载或查看，没有帐号？立即注册
OpenType-SVG is a font format in which an OpenType font has all or just some of its glyphs represented as SVG (scalable vector graphics) artwork. This allows the display of multiple colors and gradients in a single glyph. Because of these features, we also refer to OpenType-SVG fonts as “color fonts”.
Back in March, Roel Nieskens wrote about his experience building a color font and described the problem that they intend to solve:
Typography on the web is in single color: characters are either black or red, never black and red.
So, with a color font, type designers can now embed multiple colors within the glyphs themselves. Then, a web designer can pick one of the options available with the font-variation-settings property in CSS. Below, I’ve made a demo that shows how this works with Trajan Color, a new font made by Adobe and now available with Typekit :
Experimenting with Color Fonts
See how different parts of those glyphs, ABC, have different hints of color inside?
What this means is that when it comes to emoji and display type, designers will soon have more interesting choices at hand. For now, browser support isn’t that great but Adobe has provided everyone with a heads up over on the Typekit page designed by Nick Sherman :
Browser support for color fonts is still evolving, but exists in Firefox and Microsoft Edge (IE), and we expect more browser manufacturers will adopt the format before long. In browsers that lack color font support, they will fall back to regular monochrome glyphs.
I think that final point, about how color fonts fallback, was best illustrated by Roel Nieskens, which ought to be the perfect, progressively-enhanced thing that could happen in this situation:
Experimenting with Color Fonts
Here are some examples of color fonts that you can experiment with today:
But beware! There are a few problems with this approach. The most troublesome being the size of the font file in my demo above: it’s 593 KB in all. Although, to be honest, in most projects we probably won’t need to load every variation of the color font which will greatly reduce the size of the font file we serve.
- Trajan Color
- Emoji One
- Bungee by David Jonathan Ross
- Bixa Color
Secondly, it doesn’t appear that in CSS it’s possible to change the various colors inside a color font. So for a while, we’re stuck with whatever styles type designers provide for us in the font files themselves.
Regardless of those two pain points, though, I’m still very much excited by the emergence of color fonts and what that could mean for typography on the web. I can see old woodtype styles in particular coming back thanks in part to this new font format.
Make sure to check out the demo below (with Firefox or Edge) to see the color font effect:
See the Pen Color fonts demo by Robin Rendle ( @robinrendle ) on CodePen .
上一篇：Lead by Design, but Stay Classy!