Rendering text with letter outlines

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

BigG
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Tue Oct 13, 2009 14:25

Rendering text with letter outlines

Postby BigG » Mon Oct 26, 2009 15:17

Hi,
lately I needed to render text above an image (item icon for example) and stood afront the following problem: Making the Text as clearly visible as possible while keeping as much as possible of the icon visible. I wanted to solve this by rendering the text with highly contrasted outlines (for example white text with black outlines), similar to how it's done in famous World of Warcraft:
Image (Yea I'm a Paladin :D)
I found this a really good solution as the text will be clearly visible on almost any background - be it dark (then you have a contrast to the bright inner) or bright (then you see the dark outlines). How would I realise a similar effect using CEGUI? I have browsed through the CEGUI properties and classes but I could not find anything resulting in such outlines :shock:

Greetings and thanks in advance,
-BigG

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Rendering text with letter outlines

Postby Jamarr » Mon Oct 26, 2009 17:22

Hi, font effects are not natively supported in CEGUI afaik nor does FreeType2 (the font library that CEGUI uses) have any support for this. Typically what you'll want to do is use bitmap/pixmap based fonts that already have the desired effects built into the font itself. There are several programs on the web for creating such fonts, and you can find one linked from this thread.

The other, less efficient option is to render the same text twice with slightly different sizes and/or offsets as described in this thread.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

Exponent
Just popping in
Just popping in
Posts: 1
Joined: Mon Oct 26, 2009 19:14

Re: Rendering text with letter outlines

Postby Exponent » Mon Oct 26, 2009 19:18

A third option, which is quite flexible and of high visual quality, but as a side effect is a bit more complex to implement, is described in this article from Valve Software. There is some discussion on it over in this thread on the Ogre 3D forums, which is where I discovered this method.

BigG
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Tue Oct 13, 2009 14:25

Re: Rendering text with letter outlines

Postby BigG » Tue Oct 27, 2009 14:36

Thanks for your replies guys :)
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=3875 seems like it's exactly what I wanted, strange enough I couldn't find it when searching for several keywords like "font outlines" and similar. As we are going to create our own font anyway, it won't be a problem to create it as bitmap font I guess. That tool also seems really good, will check it out soon :D The valve article is really interesting but it looks quite overkill for a fun project of a few not-even-adult people :)

Greetings,
-BigG


//Edit:
Yea, using that REALLY great tool, I managed to achieve exactly what I wanted :) thanks again!

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Rendering text with letter outlines

Postby Jamarr » Wed Oct 28, 2009 00:07

I'm glad you got it worked out. Using a custom font is definitely one of the easier approaches you can just pick up and start working with almost immediately.

I agree that the Valve article is indeed interesting, and it seems distance-field usefulness goes far beyond what that article touches on. In regards to CEGUI I'm uncertain how much work it would take to support distance-field texture maps, but it could be an interesting experiment. CE also made it easier to incorporate shaders in v0.7, so extending that to include effects like outlining, shadows, etc. would be pretty neat.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 6 guests