![]() |
|
Font with drop shadow? Outline? |
LitmusDragon
Member #14,812
January 2013
|
How can I make a font display with a drop shadow or with an outline around the font using Allegro 4.4.2? I gather something like this may be possible by making a transparent font and using burn blend mode but I can not find any example programs that tell me how to do this. |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Drop shadow is easy, blit it twice, once for the shadow. Outline is harder, use larger font centered letter by letter on the text in front of it. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Oscar Giner
Member #2,207
April 2002
![]() |
Edgar Reynaldo said: Outline is harder, use larger font centered letter by letter on the text in front of it. That gives pretty bad results. Drawing a first with a bold version of the font and then the normal version on top works better. -- |
Arthur Kalliokoski
Second in Command
February 2005
![]() |
There are outline TTF fonts, by the way. They all watch too much MSNBC... they get ideas. |
Kris Asick
Member #1,424
July 2001
|
So long as the drop shadows or outlines don't cross into other glyphs due to being only a pixel or two wide, Edgar's solution will work. However, with doing more traditional drop shadows that are large and faded, or outlines intended to blend into itself, you're in trouble due to the way Allegro's font rendering system works. You would have to write your own font drawing routine to draw each glyph one at a time so that the shadows/outlines would overlap properly and you would of course have to blend them together, but the big problem is that you need to use alpha blending to pull this off, which means if your drop shadows or outlines come in more than just a single colour, they will conflict with each other. That is a problem better solved with hardware acceleration and fragment/pixel shaders. --- Kris Asick (Gemini) |
simast
Member #12,668
March 2011
|
As far as I remember FreeType has ways to produce outlines (via glyph transforms comes to mind, but I think I saw some of other outline related API stuff there) and it could use hinting in the process. So I think the "best" solution is to have outlining implemented in the font addon.
|
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Simast said: So I think the "best" solution is to have outlining implemented in the font addon.
Congratulations, you just volunteered! My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Neil Walker
Member #210
April 2000
![]() |
Allegro 4 was so last year, it's time people moved on. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
jmasterx
Member #11,410
October 2009
|
What ever happend to this? https://www.allegro.cc/forums/thread/611384 Agui GUI API -> https://github.com/jmasterx/Agui |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Ever finish that patch for the font borders Trent? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Mark Oates
Member #1,146
March 2001
![]() |
I, too, would support the decision to include a font outline feature in allegro. -- |
André Silva
Member #11,991
May 2010
![]() |
Seconded. It really shouldn't be too mind-boggling, so someone should really take care of it. Someone with time... Come on people, the world'll be a better place with outlined font drawing!
|
|