It supports the full range of iOS fonts (http://iosfonts.com/) and all characters. I’m hoping this rendering method won’t be too slow for dynamic text.
I chose to use built in iOS text drawing to render into a texture, that texture is then rendered in OpenGL.
What this means is for every new piece of text (changed string, changed font size, wrapping, etc) Codea will need to render a new texture. I have a caching system for text that doesn’t change, but something that increments constantly (like a high score) will need to generate a new texture every frame. This shouldn’t add too much overhead if the dynamic text is fairly small (the new setContext function does the same thing).
The benefits of this method is access to all fonts, international character support, support for huge font sizes, wrapping and so on.
Also - my plan is to have text colour be determined by the current fill colour. Would you prefer this? Or would you rather have tint control the text colour?
Looks beautiful. As you say, the method of rendering to a texture presents potential performance issues, but I think the idea of using the built in iOS font rendering is the right approach.
I am a connisouir of fonts, and my expert opinion is "Mmmmm pretty. "
Someone doing something that updates frequently where speed becomes a problem could simply render digits (for a score, say) to images and use those.
I like tint being meta - the use case in my brain is “player takes damage so screen tints red then fades to normal”, and that’s eliminated if we use it for text color. (hmm, I coul do a screen sized red image and vary the alpha… Would be similar effect)
You’re adding font() and text() And textWrapWidth() and textAlign() - add textColor(). Or, if a proliferation of methods bug you, make textProperties() and let us pass pairs or a table.
And give us a way to do it non-filled (outline) if it’s easy.
Or ship it this way! This is more than “enough” for most definitions of “enough”.
Now… THIS IS AWESOME! It’s MUCH better than what I expected. You have access to ALL iOS fonts (including EMOJI!), ALL possible size, ALL possible international character. For me, this is more important than the drawing speed. If one really need the speed, s/he can use other techniques. Thank you, @simeon.
About the coloring, I prefer using fillfor the text body color and strokefor the text border color. So, we could draw outline text. I can’t wait for the next update!