Suggestion: Font outline/shadow

Started by Necro, Wed 23/07/2003 18:25:01

Previous topic - Next topic

Necro

Importing ttf font are exellent , but I find myself wanting some font with outlines or shadows.

Would it be possible to import a font then have a box displaying whether you wanted it imported as normal or having AGS make an outlined version and shadowed version of it.

[*cough* RC2 *cough*]

TerranRich

This has been suggested many times. I agree with this suggestion however, and I think maybe CJ should bump this one upward on his to-do list, if it's even in there. I didn't see it in there, or in the tracker. Someone should've added this to the tracker at least by now. :)
Status: Trying to come up with some ideas...

RickJ

Why don't we just ask someone to make a seperate font outline generator?  AJA seems to have a handle on how to do it (see thread link below), is he is listening maybe he would like to comment.  In the thread below he was discussing about how to do an AGS plugin to generate outlin fonts.  

[ur]http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=7305;start=msg90[/url]

Are there any other font experts out there?  Great challange eh!




Necro

I think AJA's outline plugin would over complicate things. plus increase filesizes when it wouldnt need it. You could however great a font outliner as a seperate tool from ags the simply generates sci-fonts normal/outline/shadowed.

CJ please make it so.

AJA

#4
QuoteI think AJA's outline plugin would over complicate things

That depends... if AGS would allow a plugin to fiddle with the fonts before they are displayed all you'd have to do is set (in the game_start function) which fonts should be outlined. I haven't yet quite had any experiements with outline generation for fonts because I haven't quite been able to draw text on a blank bitmap... :P

-EDIT-

Or the other way would be that I'd create similar functions to DisplaySpeech etc.... The only difference would be that my functions would create outlines... Still haven't got the draw text on a blank bitmap working... :(

-EDIT2-

IT WORKS!!! ;D I'll just tweak it a bit and show you then how it looks like... :)

AJA

#5
Here it is: http://koti.mbnet.fi/dima/downloads/fontoutline.zip
There's an example... again. Here's all the info you'll need (hopefully):
Print (x, y, font, colour, text);

And this is ALPHA!

-EDIT-
link fixed tho' the problem wasn't with the link (i had named the zip incorrectly :P)... thx, Zeuz!

Necro

Wow that was quick! amazing. well I see its certainly achievable....

CJ should add it to his list for ags NOW!! , but I think I'll be keeping an eye on your plug-ins AJA.. :D


RickJ

AJA, what I was asking if it's possible for you to make an outline font generator so that this wouldn't need to be done at runtime.  Seems like you may have done all the heavy lifting already to accomplish this.  Maybe you could simply add the ability to wirte your fonts out to an AGS supported font file?  The alternative, of course would to be to make a standalone allpication to do the same thing.  This would negarte the need of something being added to the AGS editor itself.  What do youthink?  Is it a possibility?

Necro

yes this is what I was meaning too... people would want to add 100-300k to thier games if they could make the fonts before hand.

Cerulean

Another angle on this: Remember antialiased ttf? Chris removed it because dialogue was being shown antialiased with "transparent pink" and there was all this pink junk around the words. But I think if it used black instead of pink, it would probably look like an fairly good outline, behind smooth text to boot. I would ask that the feature be reactivated, modified to use the shadow font color as the assumed background when rendering the antialiased text.

Necro

and remember option to outline OR shadow . don't forget shadow because that looks cool sometimes too.

Pumaman

I'm not sure how AJA is generating outlines, but I might try an auto-outline thing by drawing the font a few times at 1-pixel offsets in different directions. I'll give it a go and see how it looks at some point.

AJA

CJ: I used the same method for the creditz plugins outlining, but it turned out REALLY slow with ttf fonts (tho' they were scrolling so it probably won't affect so much with static text :P)... otherwise it worked quite nicely, if I remember correctly.

This is what my outline plugin does:
1. I create a new bitmap for the text
2. I draw the text onto the new bitmap
3. I get the transparent color from the bitmap
4. My outline generation function creates a new outline-bitmap which is 2 pixels wider and higher than the original one.
5. I run a loop which checks if a pixel of the bitmap is not transparent. In this case it draws an outline pixel to these coordinates (x+1,y; x-1, y; x, y+1; x, y-1).
6. The loop also draws the font again so that the bitmap will contain the outline and the original bitmap on it so that I won't have to first draw the outline and then draw the text.

Quite easy... Tho' I haven't yet tested how much this slows down the engine if it does. :P


RickJ: I have no idea how to do any binary stuff etc. So I wouldn't be able to make a program that could write SCI font files... not yet at least... :(

RickJ

AJA: I can appreciate that.  Ijust thought it was worth asking the question though.    


Necro

not to be too greedy , but if your doing the pixel offset thing then you could possible have 2 sets of an out line a light and full version... light being offset of x-1 , x+1, y-1, y+1 giving a rounded corder outline and the full being all offsets for the square corner type outline.. (x-1 & y-1,x=0 & y=0, X=1 & y=1...ect)

AJA

yup... I just made it the "faster" way... :P

Ciro Durán

I have the same problem, although not with the speech fonts, but rather with the way I designed the GUI, as you can see this picture:


(Please ignore the fact it's in spanish :P)

The "sentence" part is directly over the play screen, when the AA enters, it leaves the pink fade.    It would be really cool if CJ could fix this, although I recall Allegro only uses #FF00FF color to use transparencies, I might be wrong.

Maybe my temporal solution will be making a black box behind the sentence... :P (bummer)

TerranRich

Just draw the text with a black outline in a paint program, then import it as a sprite with an invisible background (no anti-aliasing though). :)
Status: Trying to come up with some ideas...

Ciro Durán

Quote from: terranRICH on Sat 02/08/2003 05:26:10
Just draw the text with a black outline in a paint program, then import it as a sprite with an invisible background (no anti-aliasing though). :)

Well, the problem is that the text is constantly changing (It's the equivalent in english of the "Talk to", "Walk to", "Look at", etc.), that's why is the "sentence" part of the GUI, sorry if I wasn't clear :P (I won't do 1000 sprites for that part, I'd had a 50Mb game, and no hair trying to do that)

SMF spam blocked by CleanTalk