We switched from an icon font to SVG
ianfeather.co.uk
ianfeather.co.uk
Chrome Canary and Beta were hit with a fairly horrible font bug recently. If
you haven't yet noticed the bug, fonts have been unloading and reverting
to a system font after the page has experienced a period of inactivity.
Holy shit, I just assumed it was something borked in my setup (especially since I've been messing with fonts and font paths a lot recently).Mostly hit Wikipedia, but occasionally saw it in other places too.
Document Font Toggle ( https://addons.mozilla.org/en-US/firefox/addon/document-font... ) helps for the few sites I use frequently enough that do this, but I still don't like the inconsistency in looks it gives across websites then.
The problem is that fonts are icons, in that they are arbitrary collections of curves, shapes, and symbols, which communicate meaning only to the end-user, and are highly dependent on the end-users understanding of what the thing is that they are clicking, will do.
An icon, a font symbol, a glpyh, a ligature - these are all mere lines in the sand. You want to make another file-format with that, kid?
If I don't get your symbol, I should be able to revert to a font that I do get.
On the other hand, using SVG to pre-load values, then modifying the decomposed stack, somewhere appropriate, in order to attain sustainable realtime SVG rendering performance .. seems as if its a matter of principle. Could it be the jury is out until someone says screw it, and bases the entire OS of their new device on SVG, alone, and not much else?
That is, arguing that symbols are random seems silly. The whole point is that there is a large base of agreed upon symbols affixed with meanings already. They can even be combined to form different already agreed upon symbols.
I'm not a fan.
I like the consistency of having the same fonts that I like and find readable in my browser as I have in every other window on my computer. Browsers give me the chance to aim for that consistency by picking one font for all sites, but then some sites look terrible because they rely on some particular font to show non standardized icons.
You mean in the same way that something that looks nice in one SVG icon becomes something completely useless when using another SVG icon in its place?
You are not meant to switch font-icon fonts arbitrarily, they are part of your page design, as much as a SVG icon is.
Strong vote in favour of SVG from me.
Most (all? Not sure about Safari) use the "OpenType Sanitizer" on all webfonts, which parses and validates all of the tables and all of the offsets contained within them. http://code.google.com/p/ots
a) font-file, indexed set of glpyhs. A glyph is any set of line primitives that is associated with the symbol. We load the file of 'sub-routines to draw', and index it .. stupidly .. with some font_glyph_array[]. Which we then index, according to keycode-translation-{NSA-insert}-pipeline.
ahem
b) SVG. SVG is 'pure math', in that the glyphs and bitmaps aren't there, but rather the CPU is going to be asked to calculate things. For this reason, 'most SVG rendering libs are crap' is true, because SVG is intended to be turned into whatever is useful for your CPU, before then being re-rendered for the next frame. Of course this takes a lot of time .. but at least it prevents buffer sploits.
Hmm.
What I like about SVG is that for every id="" there is to be found, there could be a unique 'identifier' to the application, at the user level, that abstracts the <g>. So, if I want a 'button', I just wrap everything up in <g id="button">, and off we go. Of course, ymmv, and probably I'm not trawling the DOM per-frame, like you're supposed to, but hey: its a button that can be immediately Cut-/_Pasted by the designer, and I don't have to think about it.
So SVG serves the purpose of every graphics file-format, ever, which is to stop the Designer and the Programmer from actually having to talk to each other.
It happened before: http://technet.microsoft.com/en-us/security/bulletin/ms11-08...
Some systems have chosen a different path and draw the line elsewhere.
I would add a counter argument to "it feels hacky" because to me, it feels like the perfect solution: icons are symbols that we use to explain things, just like words.
The font format in particular seems perfect for this:
- One single download to get your entire icon set
- Font rendering engines have been around long before web browsers, so they are relatively mature on all platforms
- Scales just as nicely as SVG
Interesting point! But I think where it falls down is that the HTML content used to conjure a given icon is never related to the icon's content. If there was some way of representing words as icons with a font (perhaps using ligatures?), that would be one thing. But as things stand, it's still a hack.
Font-rendering is an important science and branch of Human Communication, imho, and a lot of very difficult problems have been forward-solved by fontographers, before us, we must always remember! Those who propose to make new symbols must be compelled not to forget the old!
Then you run into someone like me whose eyes are not as young as they once were, and who doesn't care to be abused with whatever happens to be the stylish designer's font palette du jour, and who therefore uses his browser settings to apply a minimum font size and a set of preferred typefaces which page styles aren't allowed to override, and then everything goes to hell.
Can you argue that it's my fault, not yours, that your page doesn't render well under the requirements I impose on the web content I consume? Sure, you can so argue. But every time you have to make that argument with a user, even if you win the argument in that instance, you're still both limiting your potential user base and risking a perception that you're less concerned with your users' needs than with satisfying your own desires.
Also, note that you apparently don't assign any culpability to browser vendors for the state of affairs. I encourage you to revisit that, plenty of blame to go around.
I'm not sure which portion, of the blame in question here, you contend belongs properly with browser vendors. There are lots of things they might do differently, but I don't see how this is one of those.
Eventually such fonts will inevitably fall out of style. When that happens, will we be left with a useless ecosystem surrounding a fundamentally inflexible core? Or will font rendering engines have evolved to adapt?
I'm not sure what you're referring to here. Bootstrap's use of font icons? If font icons ever became an issue, they could easily[1] swapped out of such frameworks.
Also note that font icons are also useful in places that can only display text, but allow for changes in fonts. You can see people make use of such icons for things like (e.g.) displaying the weather in xmobar or dzen.
[1] Might be a bunch of work on the back-end, but I don't see how the interface would change all that much. You get the icons now by just applying a class to an element, just the behind-the-scenes CSS would have to change.
More contemporarily, other marks/icons we now would think of as standard are really icons for language control or words themselves. Typographers have been using monochromatic marks and glyphs since the dawn of the printing press.
So, not a flash in the pan.
edit: caveat for animated elements.
http://www.sencha.com/blog/the-html5-scorecard-the-good-the-...
https://wiki.gnome.org/action/show/Projects/LibRsvg?action=s...
Chrome is puzzling and suggests that there are other factors at play that result in poor performance here.
I always wonder at all these HN comments about impossible to read sites, is it the computer, the software, the display or the thing that sits between the keyboard and the chair?
This is what I see pixel scaled 200%: http://i.imgur.com/62y2Gye.png
Here's mine at 200%
http://i.imgur.com/602XxWY.jpg
Better question, how does one test for this kind of thing?
Does anyone know why exactly the font they are using on Lonely Planet looks so terrible in Windows Chrome? Is this because it's not hinted?
Screenshot: http://i.imgur.com/8W40ns4.png
vs. Safari on OS X: http://i.imgur.com/Gk9Bfg2.png
Edit: Ah, this blog post discusses it: http://www.dev-metal.com/fix-ugly-font-rendering-google-chro... I'm surprised people don't consider this a dealbreaker, considering the market share of Windows Chrome nowadays.
We ended up applying a text shadow of 0.15px to smooth out the eaten-by-mice effect. It's a bit softer, but a good compromise. Fonts with good hinting seem to work better.
* Irrelevant/meaningless characters used without textual label, which is total crap from accessibility perspective.
* Icons littering text copied to clipboard.
* Awful loading performance. Browsers optimize image loading very well: preload scanner, async loading, fetch priority, multithreaded decoding, but custom fonts almost always only start downloading after CSS is fetched, parsed and applied to the document (in order to avoid loading unused fonts), which delays loading by a network roundtrip + CSS processing time and either delays rendering or causes extra reflows.
I hate seeing 99%-loaded websites with hidden text so much that I've completely disabled support for Web Fonts in my mobile browser. That's a huge improvement overall, but makes font icons a collateral damage.
Why don't you consider your font to be critical? In my experience, with Safari, if you use a custom font, text won't render at all until the font has loaded.
Note: this setup is only used sparingly on our site as it has been waiting for this piece of work to be completed.
But when I try now, I get the system font for a second, then it switches over to the custom font.
http://en.wikipedia.org/wiki/Tick_%28checkmark%29#Unicode
Does that make it an exception compared with say, the icon for facebook?
SVG allows you to create clones with the `use` element. Any style which wasn't set by the original can be set by the clone.
E.g. if you don't set `fill`, the original will be filled with black and the clones can be filled with some other color.
Basically, it lets you reuse something, but you can transform it and set some styles.
http://kaioa.com/svg/chemicalzen3.svg
http://kaioa.com/svg/chemicalzen3_parts.png
The "master" shape is used to create the outline and it's also used to clip the "interior" layer.
http://kaioa.com/svg/armyofclonesani.svgz
There is just one dude. Then there is a row of clones. And then there are transformed clones of that row. Only the original dude is animated.
Edit: A big benefit of clones is that they are always in sync. If you change the shape of the original, the clones follow suit.
Here an example, where a whole svg document is linked to from another svg element (scaled with viewBox):
<div>
<svg viewBox="0 0 500 500" width="200" height="75">
<g>
<use xlink:href="#BaseQuality-svg"></use>
</g>
</svg>
</div>I've never been really fond of icon fonts, but they've appeared to have some pretty compelling advantages not easily obtainable otherwise; I'm glad to see such a well-reasoned article describe a means of replacing them which has most of the same advantages and what looks to be a considerably narrower range of drawbacks.