Idea for a future feature: text to mesh function

How easy would it be to turn a font, size and text string to geometry that could be turned into a mesh?

It would really slow down the process of the program because I assume Codea would have to simplify (turn it to an image) the text, and then do the mesh. It would then have to test if you changed the text, and do it again.

Fonts are already stored as vectors, so there is no need to render them as images.

I don’t understand what you mean by testing if the text changes. This would be a function: pass in a string, font & font size, get back a mesh (or a table of points you can use to create a mesh).

@Nat - Sorry. I was confused. What I meant was that I thought that you would have to simplify the text to an image and then use mesh on the image, but I didn’t understand that mash can work on vector objects (makes sense). Never mind that.

@Nat you mean turning each character into triangulated geometry? It’s not possible in Codea at the moment since we don’t expose that info (unless you were to render to texture then run a tracing algorithm on the resultant texture, then triangulate() it).

We also deal with text at a higher level than that internally. It’s a very interesting thought, though.

You could do it by using setContext(), right? I haven’t tried it yet.