It’s 2015 and drawing text is still hard
engineering.eventbrite.com
engineering.eventbrite.com
Since the OP is using modules already, they might enjoy some of the libraries and tools here:
https://www.npmjs.com/package/text-modules
Or a ThreeJS specific implementation of bitmap / SDF:
https://github.com/Jam3/three-bmfont-text
And lots more reading on the subject:
http://mattdesl.svbtle.com/material-design-on-the-gpu
Some practical implementations of it:
- npm dataviz: http://mattdesl.github.io/npm-names/ (over 40k glyphs, could go higher)
- physical text: http://mattdesl.github.io/physical-text/index.html
But I'm just responding to the gimmicky title. It looks like the article has some interesting technical content to it.
Agree completely with the first part, less sure about the second. Almost everything needs to do it. Text rendering was included in OpenVG, which seems to have flopped completely. And rendering anything to the screen with OpenGL will involve coordinating with the window manager.
Mark Kilgard's gigantic NV_path_rendering extension included a LOT of font/glyph support. It surprised me as well when I first read it, but there's some interesting discussion of the rationale in the second item of the Issues list at the end of the spec [1].
[1] https://www.opengl.org/registry/specs/NV/path_rendering.txt
You can read font data directly from ttf e.g. And render text nicely with few polygons and shaders taking care of very nice accurate edge rendering.
I wrote a half finished c implementation a couple of years ago that might be useful as a reference if you want to look into this more : https://github.com/hansent/lbfont
It's mainly based on the paper/article inter book GPU gems 3.
Accelerated 2D Vector graphics are hard, when I was working on this nvidia was announcing the nv_path_rendering extension; don't know how widely this is supported these days. But I doubt it's available in webgl.
Edit: few typos...writing on mobile
More on-topic: text rendering is a hard problem, kerning and UNICODE support is only the beginning of the rabbit hole. Once you need to render Arabic, you also need bi-directional text rendering (normal text is RTL, number and latin-characters-strings are LTR), and you also need context-sensitive glyph-shaping (the same character is rendered differently depending on whether it stands alone, at the beginning, end or middle of a word).