Monday, October 27th, 2008
Typeface.js: A potential replacement for sIFR
Thanks to Nexus I saw a new project called typeface.js that offers a solution to typeface management (where you can use any typeface that you want, whether it be on the users system or not) without using Flash (which the popular, oft-mentioned sIFR uses):
Instead of creating images or using flash just to show your site's graphic text in the font you want, you can use typeface.js and write in plain HTML and CSS, just as if your visitors had the font installed locally. This is a work in progress, but functional enough at least to render the the graphic text on this site. Here's what it takes to get going: load the typeface.js library and some typeface.js fonts, then proceed like normal:
The examples area shows how the solution nicely integrates with CSS.
Having canvas and VML legacy support is great. It would be nice to allow the selection of text though, always a pain in the ....













That’s just brilliant. Was about to implement sIFR on one project, but came here and I see this, perfect timing ;)
Looking promising! If David wants to contact me at all to discuss mutual issues, problems run across, etc. I’d be more than happy to pool resources (see http://ajaxian.com/archives/custom-fonts-thanks-to-rendering-svg-font-definitions ).
.
Nice to see more people working the custom typography angle :)
not working in IE6, which means it’s basically useless in the real world. i hope i’m doing something wrong, cuz this got me excited.
This looks promising indeed. Do have a few questions about this though.
1)Do we really need this?
As Zuzana Licko once said:
In those cases you need to use something that is not necessarily intrinsically more legible, but that people are used to seeing. This is what makes certain typestyles more legible or comfortable. You read best what you read most. However, those preferences for typefaces such as Times Roman exist by habit, because those typefaces have been around longest. When those typefaces first came out, they were not what people were used to either. But because they got used, they have become extremely legible.
- Will people use the real bold, not some fake bold rendering?
- Will people make sure they have the right to embed the font?
- Do they know serif fonts are harder to read?
correction: VMWare Fusion does not show the text in IE6. But I was able to get on a PC, and it works!
Sorry about the confusion.
Aye, works on IE6 no problem, doesn’t work in Opera tho, but the sky won’t fall if one not-so-popular-after-all browser will have to render default font :p.
Doesn’t work in Safari 2.0.4. If you can ignore that though…
@westworld: Serif fonts are not harder to read, they’re easier to read; they’re just harder to correctly render at small sizes on a screen because the resolution is so low. That’s why hinting exists, and why fonts like Georgia and Cambria are so good.
If serif fonts were harder to head, novels wouldn’t use them.
Serif will come back into style when Sony and Amazon’s eInk books get high enough resolution to make them worthwhile.
Wow, very clean code to solve such a tricky issue:
http://typeface.neocracy.org/typeface-0.10.js
I especially like the simple support for different back-ends.
I really appreciate his work, it’s an interesting hack, but that’s all.
I tested this first version, and it’s really really buggy …
Also it has the common accessibility problems as sIFR and is also slowing down the client, because everything is done front-end.
I’m just gonna wait for TTF support on the next versions of Firefox and Safari … and here we go a EOT file, a TTF … nothing more.
Regarding adding support for selectable text: one possible way to accomplish this is to overlay the fallback text some text over each canvas element, but give the text color of color: rgba(0, 0, 0, 0.0);
Then when they tried to select the rendered text, they would actually be selecting the hidden overlay text which would only show up when they try to select it.
If opacity:0.0 is set, then they can still select the text, but the text selection indicator doesn’t show up (at least in Firefox).
I’m not sure I understand. If all that’s being done is “writ[ing] in plain HTML and CSS, just as if your visitors had the font installed locally”.
Isn’t this what pure CSS would do? Why not just create a CSS declaration applying a specific font to the selector and go from there? If the user doesn’t have the font, they won’t see the style.
If you’re not embedding the font, then why even bother?
This is awesome!
@Yves: I don’t understand the accessibility problem. If the plain HTML is intact for screen readers, then where’s the accessibility issue? Bots will be able to see the text as well for indexing. I believe the problem comes when you don’t have a supported browser, which is less than a fraction of 1 percent of the internet. Please explain.
Also, is it really that slow to render? I haven’t really noticed.
I’ve done some samples. I successfully converted DejaVu fonts and used them. It is working very well for:
- Firefox 3
- IE6, IE7
- Chrome
But not in Opera. I didn’t see any signifant slowness for any browser.
I tried it with H1 tag but it didn’t work.
I definetely prefer it to sIFR.
@Brad Neuberg :
– the user can’t change the font-size by zooming on IE6 (at least 20% of the global market) and Safari (5% ?) > visual accessibility ;
– it’s not selectable > breaking common OS/browser features ;
– I’m not sure how the fallback is working on Jaws, WindowsEyes, Firevox, … I wanted to test it, but don’t had the time yet ;
– well you don’t realize it’s slowing down, but anyone using Win2k, Win98 or whatever might … so it’s just blotting the client for some customized font …
Whatever : great job, but not recommendable on important websites.
@Yves:
- For a majority of browsers, this solution _increases_ accessibility. The alternative (using images for fonts) also doesn’t work for zooming and is even more inaccessible.
- Not selectable: Neither are images
- About supporting Win2k, Win98: if we let that hold back the majority of the web, then everything fails. The installed base of thoses OSes is very small (even internationally in Internet Cafes, which tend to have older machines).
I believe this is closer to being used on major websites then Yves lets on, especially because it increases search engine friendliness (SEO), which is a big deal to companies, as well as potentially increasing accessibility.
I’m generally suspicious of claims that text replacements hacks like CSS background-image replacement and sIFR are “accessible”, particularly when not backed up with evidence of testing across a broad range of usage scenarios.
For example, CSS background-image replacement that positions text off-screen fails to produce visible text for users who need to use their own (perhaps high contrast) color settings. sIFR typically positions the hidden “real” text exposed to assistive technology in a different place from the Flash movie replacement, which could (at least in theory) easily cause problems for users of screen magnifiers or text-to-speech aids that show a narrow view of focused text or select the text as they read it.
However, at least both off-screen text and sIFR-replaced text would work for users who are blind and using at least some popular screen reader/browser combinations. The replaced text in the official sIFR3 Beta 2 example is read out by all of the following screen reader/browser combinations with roughly default settings: JAWS 10 Beta with IE7 or Firefox 3; GW Micro Window-Eyes 7 with IE7 or Firefox 3; and Apple VoiceOver with WebKit Nightly. (Although JAWS 10 Beta appears to announce a Flash button for each replacement when used with Firefox.)
But if you try to read the offical Typeface.js example with the same user agents, you’ll find that the replaced text is not read by any of them.
I disagree with Brad Neuberg that the result with Typeface.js is more accessible than using
IMG, in which case theALTtext will be read by screen readers and text-to-speech aids, all popular browsers provide functionality to access the alternative text (whether as a tooltip, or a properties dialogue, or by the option to turn images off), and screen magnifiers and browsers with zoom functionality (IE7, Opera, Firefox 3) can zoom the image along with the rest of the page (albeit suffering pixilation). Users are more likely to be able to work around established standards likeIMGthan new hacks.Not that I’d advise using
IMGeither; plain text with CSS-applied fonts is infinitely preferable.By the by, ajaxery’s comment above (”If the plain HTML is intact for screen readers”) appears to reflect a common misconception that a typical screen reader interacts with raw HTML much as Lynx interacts with it. In fact, popular screen readers provide a speech and braille interface for desktop environments and applications, using a range of APIs specific to those environments and applications, rather than interacting with HTML directly. They are thus highly dependent on how browsers and plugins represent web content to them via those APIs. (I’ve bookmarked some resources that serve as an introduction to how screen readers really work on Delicious, for those interested.) So in the case of Typeface.js, screen reader accessibility depends on how the VML and canvas objects that replace the HTML objects are represented to assistive technology over those APIs and on the assistive technology being programmed to handle the available information.
It’s not selectable (copy and paste doesn’t work) so it’s like using images for text. Not something that I’m going to use in one of my sites: it’s detrimental to the usefulness of their content so it will drive down traffic.
Very cool, but the fact that it’s not actually selectable text is a buzz kill. Because of that I can’t envision using it for body text. Maybe headlines though… Definitely a good piece of code though!
That could prove useful
Thanks
Sometimes works on Safari/Chrome, and sometimes not.
Orca Screen Reader + Firefox 3 on ubuntu 8.04 and 8.10 also does not read the example text on the typeface.js example (or any other canvas element that i have found which seems a bit crap)
Does jaws not give you a simple way to disable javascript? the page reads perfect if i do that.
Solved the screen reader issue with a simple title attribute on the element (at least with Orca on ubuntu, tool tip shows up in ms ie7 so would assume JAWS works)
Doesn’t solve the _copy_ problem, but (in firefox {not ie7/safari} you can copy the text (from the title attribute) by right clicking on canvas and selecting “image properties”
Script is making elements vanish in konqueror :\
Very cool, but the fact that it’s not actually selectable text is a buzz kill. Because of that I can’t envision using it for body text. Maybe headlines though… Definitely a good piece of code though!
oldtimerock from color pics
not working in IE6, which means it’s basically useless in the real world. i hope i’m doing something wrong, cuz this got me excited.
oldtimerock from gratis para imprimir
It’s like using images for text. Not something that I’m going to use in one of my sites: it’s detrimental to the usefulness of their content so it will drive down traffic.
clubpenguin
I am still learning about programming right now. This is a good resource.
thanks,
Male Impotence
javascript is not as easy I ever thought
impotence problems
Wow gold Wow gold buy wow gold buy wow gold cheap wow gold cheap wow gold cheapest wow gold cheapest wow gold buying wow gold buying wow gold sell wow gold sell wow gold wow gold for sale wow gold for sale wow gold sale wow gold sale wow buy gold
wow power leveling wow power leveling world of warcraf power leveling world of warcraf power leveling wow leveling wow leveling wow gold us wow gold us wow gold eu wow gold eu world of warcraft us world of warcraft us world of warcraft eu world of warcraft eu world of warcraft eu
wow co key wow co key wow co key wow buy gold wow cheap gold wow cheap gold wow gold for sale wow gold for sale world of warcraft gold world of warcraft gold wow accounts wow accounts wow power leveling wow power leveling world of warcraf power leveling
wow leveling world of warcraf power leveling wow leveling wow leveling wow co key wow co key wow accounts wow accounts cheap wow power leveling cheap wow power leveling buy wow power leveling buy wow power leveling buy wow power leveling
There are shapes, like short cage with a vault, tall cage with a vault, short one with a flat roof among which the cage with a flat roof is the most used. Flat-topped dwarf-type tube links of londoncage is small, light, easy to carry. Usually, this cage’s height is from 21 to 30links of london bracelets cm, the diameter of the bottom is from 30 to 38 cm, section width is 0.2 ~ 0.3 cm and the spacing is 1.2 ~ 1.5 cm. For vault-type tube cage, there are links of london charms different sizes and types for choices. The most commonly used are about 50 cm high,and about 30 cm in diameter. This cage’s space is large enough for birds to move freely, however, it is inconvenient to carry.
The Windows 7 key is a usually unique, alphanumeric code of any length required by many software programs during installation. Unique windows 7 product key help software manufacturers ensure that each copy of their software was legally purchased. Windows 7 Home key | Windows 7 Professional key | Windows 7 Ultimate key | Windows 7 Enterprise key | Windows 7 Home Premium key
The unique Windows 7 serial key entered for an operating system or a software program is typically stored in an encrypted format in the Windows Registry, making finding one very difficult without some help. The above linked guides should help find just about any Windows 7 CD key you may be looking for.Windows 7 Home product key | Windows 7 Professiona productl key | Windows 7 Ultimate product key
This Windows 7 product serial number, if it exists, is the generic Windows 7 Home product key that Microsoft allowed your PC builder to use when mass producing computers. In other words, everyone’s disc has the same product key. Your unique key for use when reinstalling Windows will be the one on the sticker on your computer. Windows 7 Enterprise key | Windows 7 Home Premium key
The xbox live points is the second video game console produced by Microsoft, and the successor to the Xbox. The xbox 360 live points competes with Sony’s xbox 360 live 1600 points and Nintendo’s Wii as part of the seventh generation of video game consoles.xbox live points card xbox 360 live points card
Some major features of the Xbox 360 are its integrated xbox 360 live 2000 points that allows players to compete online, download arcade games, game demos, trailers, TV shows and movies and its Windows Media Center multimedia capabilities. The xbox live 2000 points also offers region specific access to third-party media streaming services such as Netfilx in the USA or Sky TV and xbox 360 live 4000 points in the UK.
The xbox live 1600 points was officially unveiled on MTV on May 12, 2005, with detailed launch and game information divulged later that month at the Electronic Entertainment Expo (E3). The xbox live 4000 points sold out completely upon release in all regions except in Japan and, as of October 2009, nearly 34 million units have been sold worldwide. The xbox 360 live 3000 points is currently available in two configuraions—the “Arcade” and the “Elite”—and each has its own selection of accessories.
Buy Kamagra Earn Google M65 Jacket Viagra Cialis Cheap Kamagra Cheap Viagra Cheap Cialis Make Money on Google M65 Field Jacket Airline Dog Carrier Airline Dog Carriers Viagra Cialis Earn Google Airline Dog Carrier Airline Dog Carriers Airline Approved Dog Carriers ED Hardy Wholesale Copy DVD Software How to Send Fax 14k Yellow Gold Redneck Costume 14k Gold Heart Tandem Baby Stroller