Thursday, April 9th, 2009
Fabien Ménager has created an interesting new library called canvas-text that simply “adds the three canvas text functions (strokeText, fillText and measureText) to the canvas implementation of the browsers which don’t already have these functions (Firefox 2/3.0, Internet Explorer 6+, Opera 9+, Safari 3, Chrome 1.0). It doesn’t change the already implemented functions in Firefox 3.1+, Safari 4 and Chrome 2.”
Having the methods work is one thing, but what about the performance?
Well, there are some interesting examples for you to test:
I talked to Fabien about performance and he shed some more light:
The only bad performance issues are the font face download, JSON eval,
and data parsing. I try to use a cache when possible, but it’s not
A workaround would be to have two font face files : a full one, with
lots of characters, and a reduced one, with only the common ones. The
browser cache does the rest for the font face file download
(downloaded via Ajax or a script tag).
For IE, I think I’ll have to make a VML renderer for IE that wouldn’t send the
instructions to ExCanvas but would work directly on the VML.
Obviously, this is something I really want to play with and see how far we can get with this type of thing and Bespin. It is very much in an alpha state right now, but looking good.
Posted by Dion Almaer at 8:06 am