Alpha Font
Displaying 1-6 of 6 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
RageCage

AlphaFont

With AlphaFont you can display anti-aliased fonts with any color you want without having to make seperate image files ^_^

its a simple little function I created and decided I would release since its extremely useful and powerful... well as far as powerful can go with a font. All it lacks is being able to set the font size...

EDIT:
by special request I have also added a font that you can use with the alpha font function here

Posted on 2004-06-07 21:41:51 (last edited on 2004-06-07 22:05:28)

sabernet

SWEEEEEEEEEEEEEEE [e to the power of lots] eeeeeeeeet :)

Posted on 2004-06-07 22:27:54

RageCage

hmm, it appears theres a little left over width height thingy... you might wanna change that your self but it should only be a problem if you use a font bigger than what it has set... I'll make it auto soon enough

EDIT:
err.. I dont quite know how to go about doing that... just set it your self or tell me how to make it automatic =p

Posted on 2004-06-07 22:37:17 (last edited on 2004-06-07 22:41:09)

RageCage

alright, a final note.

if you want to use variable width with this function... You must fill the pure black in the font with magenta. note I say only the pure black so that you keep the antialiasing.

Posted on 2004-06-08 04:02:48

Buckermann

Here is another, bigger AA font (Humanist26x23):

This one works with variable width.



And RageCage, may I ask why you didn't used FontHeight() and TextWidth for the calculation of the dimensions? In my opinion that way it would be more versatile:

/********************************************
****Alpha Font function by Tristan Michael***
****Method is credited to Toen.**************
*********************************************
**********Last Updated: 6/7/2004*************
*********************************************/

void printAlpha(int x, int y, int dest, int font, int color, string txt){

int width=TextWidth(font, txt);
int height=Fontheight(font);

int fill=newImage(width, height);
rectFill(0,0,width, height,color,fill);

int alphaFont=newImage(width, height);
rectFill(0,0,width, height,0,alphaFont);
printString(0,0,alphaFont,font,txt);

alphaBlit(x,y,fill,alphaFont,dest);

freeImage(fill);
freeImage(alphaFont);
}

Posted on 2004-06-09 17:20:58

RageCage

Quote:Originally posted by RageCage

hmm, it appears theres a little left over width height thingy... you might wanna change that your self but it should only be a problem if you use a font bigger than what it has set... I'll make it auto soon enough

EDIT:
err.. I dont quite know how to go about doing that... just set it your self or tell me how to make it automatic =p


^- Thats why.

thanks for telling me though ^_^


EDIT:

It seems that fontHeight() instead returns the font width... vec!!!

no wonder the function was undocumented

Posted on 2004-06-09 20:36:08 (last edited on 2004-06-09 20:44:52)


Displaying 1-6 of 6 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.