Getting lowercase letters into Font.c.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
sumasshu
Posts: 3
Joined: Thu Aug 04, 2005 2:11 pm

Getting lowercase letters into Font.c.

Post by sumasshu »

I am almost done creating a text input prototype for the PSP based off of the Hello World code, and am running into a problem with the font. I need to be able to display both uppercase and lowercase letters, but the font that's in font.c uses uppercase letters for both the uppercase and lowercase letters. I have been trying to figure out how exactly that file font.c was generated, and trying to figure out exactly how it works.

Does anyone know how the file font.c was created, and how I could get lowercase letters in there?

And more of a programming question, can someone please explain to me how exactly each character in the font is represent by only 8 hexidecimal characters? Hmm... thinking about it more, is it using bitwise operators? One hexidecimal number per line, and then one bit per horizontal pixel? If that's the case, wouldn't that mean that only 4 pixels could be displayed on each line for each character, because there are only 4 bits in the number 16 (or am I completely wrong about that?) Ahhh, the numbers aren't 16, but 64! Which gives us 8 bits! Sweet. I've been trying to figure that out all night. :) (I'll leave that there just in case anyone else is wondering how the font works...)

--Tom 'sumasshu' Oliphant
sumasshu
Posts: 3
Joined: Thu Aug 04, 2005 2:11 pm

Post by sumasshu »

Alright, using a program called FontGen (http://www.8052.com/users/bahrio/fontgen.phtml), I was able to convert some text to hexidecimal and use it in my code. I couldn't get the fonts to be exactly 8 pixels high though, so I had to copy select lines of the letter code and paste it into my font file. There are probably programs that are better suited for doing this (for making the font exactly 8 pixels tall and wide), so if you know of one, be sure to post it here.

My text input prototype is ready to be released. I'll put it up on PSPupdates tomorrow night after work.

--Tom 'sumasshu' Oliphant
PspPet
Posts: 210
Joined: Wed Mar 30, 2005 2:13 am
Contact:

Post by PspPet »

(not PSPSDK specific)
> ... I need to be able to display both uppercase and lowercase letters,
FWIW: the WiFi .02 sample includes a modified version of Nem's original "pg.c" code. I replaced the upper-case only font with the classic 8x8 pixel EGA font (see "font_ega.c_" - compatible with the original "font.c")
http://www.aibohack.com/psp/wifitest.htm (notice descenders on "py" of SpyWatch)
http://www.aibohack.com/psp/wifi_sample_002_src.zip (source)
sumasshu
Posts: 3
Joined: Thu Aug 04, 2005 2:11 pm

Post by sumasshu »

Thanks a lot PspPet. That font works great!
Post Reply