shadow wrote:
Am I right that the bitmap font ways you described have only one texture-subimage for each char? A String like "slick" so would rendered with 5 passes, for "s", "l", "i", "c" and "k"... and the tools you mentioned can apply various effects, including outline, to this subimages. If I understood that correctly then an outline of a rendered character would "overpaint" the previous rendered character. This is what I saw the advantage of UnicodeFont in, which can render 10 chars, if I set the effects accordingly. First 5 for the outline, then another 5 for the actual font...
Why is 10 characters better than 5? That's twice the amount of rendering needed for the same string. Thankfully that's not how it works.
In short, here's how Slick renders fonts using OpenGL:
- When you call drawString, we start QUAD rendering with glBegin -- as if we called Image.startUse on the font texture.
- Then, for each glyph, we specify four vertices with proper texture coordinates -- as if calling Image.drawEmbedded or SpriteSheet.renderInUse
- We finish rendering by calling glEnd, which sends the vertex data to the GPU and renders the various quads on screen -- as if we called Image.endUse
For bitmap fonts, all of the effects are applied to the texture already (i.e. look at the PNG file and you'll see the outline).
For unicode fonts, the effects are applied to the texture during runtime, when you load the glyphs (this is why it takes so much longer to load a unicode font).
So in both cases, the effects will already have been applied -- rendering the text "slick" would be rendered in one 'pass' by drawing 5 textured quads.
Quote:
Btw: @davedes: Ok, no offense, but why should outlines look tacky? Its the only way in my opinion to make text looking readable on arbitrary undergrounds:
Yeah, in that case I can see its use. I figured you were using outlines as decoration for a large logo/banner/header text. In that instance, (IMO) it would be better to add decorations in Photoshop or a similar program.