Working with fonts

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Working with fonts

Post by dospro »

Hi. What library would you recommend for working with fonts? I 've tries SFont which i couldnt make it work correctly. Also by searching in the KOS i found some biosfont.h which is horrible, but at last works. I also found parallax which i havent tested. What would you use? What's the best choice?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

The stuff already in KOS all uses SFont internally, I think. You may as well just use code from Parallax.
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by dospro »

If it uses SFont, where are those routines, inside the SDL header?
By the way, does the SFont included in KOS has its own font? Or do i have to open one?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
OneThirty8
Damn Dirty Ape
Damn Dirty Ape
Posts: 5031
Joined: Thu Nov 07, 2002 11:11 pm
Location: Saugerties, NY
Has thanked: 0
Been thanked: 0

Post by OneThirty8 »

If you're talking about this (as your mention of SDL would indicate), I've played with SoFont, which I'm pretty sure is "the same thing," but a clone written in C++ instead of C. If you're using SDL, it's fairly straightforward. I'm pretty sure it comes with an example or three. If you're not using SDL, check the parallax example. That uses txf fonts, which I'm sure you can find on the internet, and if BlackAura thinks something is a good idea, he's usually right.
c99koder
DC Developer
DC Developer
Posts: 200
Joined: Wed Oct 17, 2001 7:44 pm
Location: East Windsor, NJ
Has thanked: 0
Been thanked: 0
Contact:

Post by c99koder »

You can also generate your own txf fonts from ttf fonts using ttf2txf: http://celestia.teyssier.org/ttf2txf/index.html

Bitstream Vera looks pretty nice, it's what I used in DCSquares and TikiBlap.

-Sam
Image
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by dospro »

Im using SDL. I dont know why but SFont doesnt work. It sometimes show garbage. I got fed up with it and am trying to use the biosfont.
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
OneThirty8
Damn Dirty Ape
Damn Dirty Ape
Posts: 5031
Joined: Thu Nov 07, 2002 11:11 pm
Location: Saugerties, NY
Has thanked: 0
Been thanked: 0

Post by OneThirty8 »

dospro wrote:Im using SDL. I dont know why but SFont doesnt work. It sometimes show garbage. I got fed up with it and am trying to use the biosfont.
Maybe try showing a little of your code that used SFont? My guess is that you just don't have the font loaded properly. The bios font will probably work with SDL but it's not exactly the nicest font you'll see, and you'll have to do all of your other drawing, call SDL_Flip or SDL_UpdateRect and then draw whatever with the bios font. Otherwise, I'm pretty sure you'll just end up covering whatever you write the instant you refresh the screen.
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by dospro »

Yep, i have fixed the problem with biosfont, but i still would prefer SFont.
I am sure the font is loaded correctly, i can see some of the characters in screen, but not as i want. I will put an example.....
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
Post Reply