3 ms·
I'm having a hard time imagining when this would be preferable to SVG text.
by couchand 12y ago
I'm having a hard time imagining when this would be preferable to SVG text.
- Zikes 12y agoI'm sure it works well in the context where you are already using canvas, perhaps for a video game.
- taylorbuley 12y agoI once put a good deal of effort prototyping a full-featured <canvas>-based video player. One feature was subtitles, which was text-on-canvas. I found that an absolutely positioned div beat the pants off the performance of rendering text to canvas in almost all scenarios. In fact, I would almost never espouse layering of canvas rendering, and rather propose the layering of <canvas> elements themselves and letting markup engines take care of the composition.
- mrspeaker 12y agoThere are quite a few "canvas-only" environments now (like Create.js that they built it for)... my favourite in Ejecta http://impactjs.com/ejecta http://impactjs.com/ejecta - that let's you wrap up your canvas games/experiments in an iOS app that run really fast (for canvas!)... the guy re-implemented most of the canvas API on top of openGL. I used to get a good frame rate even on my ancient iPhone 3G. I used simple old-school style bitmap fonts there, though. More retro ;)
- diverted247 12y agoOur use case was web2print and mobile support was a big issue. SVG is great but it has mixed mobile support and performance varies. With <canvas> we are able to control rendering fine grained so when the app is not interacted, it is imagelike in performance. Most of the features in txtjs can easily be ported to SVG as the primary renderer required is SVGPath. FontLoader/Fonts would require zero change but new controls would need to subclass SVG elements. I am very interested in seeing better text in SVG as well as on <canvas> for creative use.