Live data from Hacker News

Txt – A canvas font and typesetting engine

txtjs.com

1–10 of 21 posts

Re: Txt – A canvas font and typesetting engine

#6
post #4
post #2

I'm having a hard time imagining when this would be preferable to SVG text.

I'm sure it works well in the context where you are already using canvas, perhaps for a video game.

I once put a good deal of effort prototyping a full-featured -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 elements themselves and letting markup engines take care of the composition.

Re: Txt – A canvas font and typesetting engine

#8
post #2

I'm having a hard time imagining when this would be preferable to SVG text.

There are quite a few "canvas-only" environments now (like Create.js that they built it for)... my favourite in 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 ;)

Re: Txt – A canvas font and typesetting engine

#10
post #2

I'm having a hard time imagining when this would be preferable to SVG text.

Our use case was web2print and mobile support was a big issue. SVG is great but it has mixed mobile support and performance varies. With 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 for creative use.

Post reply on HN