Displaying characters

Hi there,
I’m new to the list, but I’ve been using SDL for a long time with OpenGL. Now, I’m
looking to make
2D graphics with it and the most tricky part is about characters or fonts.

I’m wondering what’s the best way to draw characters and from what format. I’ve never
dealt with
fonts, but I’m willing to read on the topic. I figured the best and easiest way to draw
chars on screen
would be to read a keymap image and copy parts of it on screen. But the keymap would need
to be
created on a special format to be readable - I mean, the characters will have to be
perfectly aligned on
some sort of grid. And then I would be stuck with one keymap image for every fonts and
every sizes
I’d need. Not quite efficient.

So I was wondering if there were other techniques around. I don’t want to use someone
else’s work,
I’m learning, so I have to reinvent the wheel to see how it works before I do anything
else.

Please if you know any site with information regarding font display that you think is
worth reading,
please reply with the URL.

Thanks in advance,

xm

This little program might help you alott with creating the font-images.
At least if you are a windowsuser.

http://www.lmnopc.com/bitmapfontbuilder/
The program creates Charactermapps from any windows-compatible font for
you.

Before I found this program I once made a character map by hand in
PhotoShop and it’s not a very teaching experience, just loads of
boooooring work.

/JakobOn Mon, 2 Aug 2004 22:55:11 US/Eastern, wrote:

Hi there,
I’m new to the list, but I’ve been using SDL for a long time with
OpenGL. Now, I’m
looking to make
2D graphics with it and the most tricky part is about characters or
fonts.

I’m wondering what’s the best way to draw characters and from what
format. I’ve never
dealt with
fonts, but I’m willing to read on the topic. I figured the best and
easiest way to draw
chars on screen
would be to read a keymap image and copy parts of it on screen. But the
keymap would need
to be
created on a special format to be readable - I mean, the characters will
have to be
perfectly aligned on
some sort of grid. And then I would be stuck with one keymap image for
every fonts and
every sizes
I’d need. Not quite efficient.

So I was wondering if there were other techniques around. I don’t
want to use someone
else’s work,
I’m learning, so I have to reinvent the wheel to see how it works before
I do anything
else.

Please if you know any site with information regarding font display
that you think is
worth reading,
please reply with the URL.

Thanks in advance,
xm


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

For 2D fonts take a look here:

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=13

For 3D fonts, here:

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=14

Regards,

Andr?On Mon, 2 Aug 2004 22:55:11 US/Eastern, wrote:

Hi there,
I’m new to the list, but I’ve been using SDL for a long time with
OpenGL. Now, I’m
looking to make
2D graphics with it and the most tricky part is about characters or
fonts.

I’m wondering what’s the best way to draw characters and from what
format. I’ve never
dealt with
fonts, but I’m willing to read on the topic. I figured the best and
easiest way to draw
chars on screen
would be to read a keymap image and copy parts of it on screen. But the
keymap would need
to be
created on a special format to be readable - I mean, the characters will
have to be
perfectly aligned on
some sort of grid. And then I would be stuck with one keymap image for
every fonts and
every sizes
I’d need. Not quite efficient.

So I was wondering if there were other techniques around. I don’t
want to use someone
else’s work,
I’m learning, so I have to reinvent the wheel to see how it works before
I do anything
else.

Please if you know any site with information regarding font display
that you think is
worth reading,
please reply with the URL.

Thanks in advance,
xm


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


? Andre’ Wagner - 2004 - All rights reserved

xm at ca.inter.net wrote:

Hi there,
I’m new to the list, but I’ve been using SDL for a long time with OpenGL. Now, I’m
looking to make
2D graphics with it and the most tricky part is about characters or fonts.

I’m wondering what’s the best way to draw characters and from what format. I’ve never
dealt with
fonts, but I’m willing to read on the topic. I figured the best and easiest way to draw
chars on screen
would be to read a keymap image and copy parts of it on screen. But the keymap would need
to be
created on a special format to be readable - I mean, the characters will have to be
perfectly aligned on
some sort of grid. And then I would be stuck with one keymap image for every fonts and
every sizes
I’d need. Not quite efficient.

So I was wondering if there were other techniques around. I don’t want to use someone
else’s work,
I’m learning, so I have to reinvent the wheel to see how it works before I do anything
else.

You can avoid using a texture by providing a display list for each
character in OpenGL (ie. each char draw lines & points).
Then, you put the DLs into a table and that’s all. You don’t want to use
someone else work, then do the DLs yourself :)–
Tek

I’m amazed no one has suggested the various LIBRARIES for doing this…

I have found that the best one is OGLFT. Get it at oglft.sf.net.
Requires FreeType.

  • Donny Viszneki

Donny Viszneki wrote:

I’m amazed no one has suggested the various LIBRARIES for doing this…

The guy states that he wants to learn. Although a library can be very
educative, the most appropriate answer is to give him a clue of methods
he requests for then let him do the work as exercise.–
Tek

This little program might help you alott with creating the font-images.
At least if you are a windowsuser.

Thanks, will be very handy!

xm

For 2D fonts take a look here:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=13

Well, this tutorial is only Windows oriented, while my work must be compatible for all
platforms.

Thanks anyway!

xm

You can avoid using a texture by providing a display list for each
character in OpenGL (ie. each char draw lines & points).
Then, you put the DLs into a table and that’s all. You don’t want to use
someone else work, then do the DLs yourself :slight_smile:

I’ve tried once and it made all sorts of jiggery lines in my characters. Then someone told
me I would
need to antialias those characters.

But all this require OpenGL and my project (being 2D) will not use OpenGL, but rather SDL
itself, only.

Thanks,

xm

I’m amazed no one has suggested the various LIBRARIES for doing this…

I have found that the best one is OGLFT. Get it at oglft.sf.net.
Requires FreeType.

As I said, I’m learning how to display characters, I don’t want to just display them.

And on the other hand, I’ll be writting commercial software soon, what is the liscence of
that library, I
checked for FreeType and it has a BSD-like liscence which is in accord with commercial
software. But
it would make my projects too big, SDL is the only library that my projects will use.

The library seems impressive, but I was more looking for documentation on how to do the
work.

Thanks,
xm

I believe SDL_ttf (also based on FreeType) is LGPL, just like SDL itself.

http://www.libsdl.org/projects/SDL_ttf/

I use SDL_ttf in Tux Paint to render text in a variety of languages.
(The placement, word wrapping, and all that was hand-coded, of course.)

http://www.newbreedsoftware.com/tuxpaint/

-bill!
bill at newbreedsoftware.com "Avoid missing ball for high score"
http://www.newbreedsoftware.com/
New Breed SoftwareOn Wed, Aug 04, 2004 at 01:12:32AM +0000, xm at ca.inter.net wrote:

And on the other hand, I’ll be writting commercial software soon,
what is the liscence of that library, I checked for FreeType and it
has a BSD-like liscence which is in accord with commercial software.
But it would make my projects too big, SDL is the only library that
my projects will use.

I believe SDL_ttf (also based on FreeType) is LGPL, just like SDL itself.

http://www.libsdl.org/projects/SDL_ttf/

If I cannot find a efficient way to make my own characters, I’ll probably end up using
that lib.

But I will try to make an efficient engine which I will probably compare to SDL_ttf.

Thanks,

xm

You may want to look at the SDL_TTF source
(http://www.libsdl.org/projects/SDL_ttf/) for rendering TTF and FON fonts
without opengl.

  • Will>> I’m amazed no one has suggested the various LIBRARIES for doing this…

I have found that the best one is OGLFT. Get it at oglft.sf.net.
Requires FreeType.

As I said, I’m learning how to display characters, I don’t want to just
display them.

And on the other hand, I’ll be writting commercial software soon, what
is the liscence of that library, I
checked for FreeType and it has a BSD-like liscence which is in accord
with commercial software. But
it would make my projects too big, SDL is the only library that my
projects will use.

The library seems impressive, but I was more looking for documentation
on how to do the work.

Thanks,
xm


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl