custom font

Hi guy,

how can i create font color 80’s style? i found “namco.ttf” but the color is one, instead I want to create colored fonts.

Thanks :slight_smile: :slight_smile: :slight_smile:

Use paint :slight_smile:

I would suggest you give a little more info about what are you trying to do, with what tools… If not, your question is a little vague :frowning:

Change the color with code D:

So hardcore!

He can’t hardcode it, so he needs to store the color to use in a TXT document. Or so I’ve heard.

No, you have to create your own Font class and draw an image for every different character! Think OOP guys!

And he has to draw/code for every character change? just make it easy, grab a freefont out there and load it :persecutioncomplex:

In my game would include custom font like this

http://www.google.it/imgres?um=1&hl=it&sa=N&biw=1440&bih=770&tbm=isch&tbnid=JAa5NjI9FvS4-M:&imgrefurl=http://blogs.sega.com/2012/05/03/more-sega-classics-for-virtual-console/&docid=rYVJOlZ0UvDhOM&imgurl=http://farm9.staticflickr.com/8145/7140153385_a49d7b4103.jpg&w=500&h=350&ei=SF8WUPPhJK2N4gTtm4GQDw&zoom=1&iact=hc&vpx=670&vpy=149&dur=369&hovh=188&hovw=268&tx=165&ty=101&sig=112535774372889635011&page=1&tbnh=118&tbnw=168&start=0&ndsp=28&ved=1t:429,r:3,s:0,i:81

be noted black border around the characters for example

I’m not your guy, friend!

Usually you have the font present in one color, that is blended into another one when needed. I don’t know what tool set you use, so I cannot give you direct advice on how you can do it. Generally your font renderer (or loader) takes care of the font color.

Slick2d for example has two classes (AngelcodeFont and UnicodeFont) to handle font rendering. AngelcodeFont works with a pregenerated image and definition file (generated with a tool like hiero or the TWL font creator). UnicodeFont does basically the same, but it takes a *.ttf file as input and the images for the glyphs are generated directly in memory (so UnicodeFont takes a bit longer to load). Basically you instantiate a version of the font. Version in this context means that you apply settings like color, style (bold or italic), a font size etc. For each font and font style, you can keep an instance.

I think you can apply an outline effect with the unicode font. On the font class, you have a method “getEffects” to retrieve the active effects (at least I think thats what it does). => http://slick.cokeandcode.com/javadoc/org/newdawn/slick/UnicodeFont.html

There you can add a new OutlineEffect => http://slick.cokeandcode.com/javadoc/org/newdawn/slick/font/effects/OutlineEffect.html

If you wan’t to have a better (or more suitable) explanation, you would have to provide more infos about what you work with (java2d, lwjgl, slick, jogl etc.)

I’m not your friend, buddy!

I’m not your buddy, guy!

Nice answer, though. I need to look into that AngelFont thing. People say it’s weird, so I might just code my own basic version of it

You serious? It’s a well-known South Park joke. Since you wrote “Hi guy” I thought you were familiar with it. I meant no harm

i think fool me.Sorry, I meant no harm