gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Need help with fonts

#30983 - ghostils - Mon Dec 06, 2004 9:20 pm

Hi , i've been diddling around with some basic ideas for creating a font system and displaying them.

I've tried creating a bitmap with photoshop that has a few characters in series for a test. Then converting with gfx2gba (1.03) with the following params: gfx2gba font.pcx font.h -8 -w 48

(as of right now I'm just testing using the standard stdio.h in a dos box using 1's and_'s to represent the bitmap and discarding pallete info for now. (just to clarify the code I'm currently working with is not running on a GBA or emu), its running on windows as a test program before it gets ported to gba specifics.

The problem I'm having is that most of the characters display fine however photoshop doesn't have the same spacing or a fixed size for the characters apparently for some of the fonts and the code will start grabbing bits from the next character inline before it should.

Is there a good solution to creating a font set in photoshop instead of hand spacing the characters out. I use the program regularly but I didn't notice a spacing option.

I'm trying to make an 8x8 px font. I also messed around with a program called imgfont that is supposed to take teh characters out of the bitmap and put them in a raw format that is easy to parse, but it didn't work as intended.

Any help would be appreciated.

-ghost[iLs]

#31005 - ScottLininger - Tue Dec 07, 2004 12:12 am

So I take it that your font engine is fixed-width? If so, the eaiest thing to do is to put the characters in a vertical row instead of a horizontal row.

In other words, instead of your graphic looking like this:

Code:
ABCDEFGHIJKL...


Do it like this, with a carriage return between the characters:

Code:
A
B
C
D
E
F
G
H
I
J
K
L
...


Photoshop does support fixed width fonts... you just have to use a fixed width font. Try "courier." You'll want to keep your kerning/letter spacing at 0 and use a pixel-sized font (10px or 12px, not 11.4pts)

-Scott

#31008 - ghostils - Tue Dec 07, 2004 12:21 am

Yeah I messed around a bit longer and got it work'n =D

Thanks for the reply though =)

-ghost[iLs]