Hardware Surfaces on X11 / nVidia TNT2

I have some custom code which does more or less the same than SFont, but
uses the alpha values in the pre-rendered font so the font color can be
dinamically set at runtime. It also does some layout, which I’m not sure
if SFont does.

I can try detaching it from the rest of the project and making it a
standalone lib. If you’re interested in the method itself, just ask!

--Gabriel

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy> ----- Original Message -----

From: Jesse David Andrews [mailto:jdandr2@uky.edu]
Sent: Martes, 20 de Mayo de 2003 02:47 p.m.
To: sdl at libsdl.org
Subject: Re: Re: [SDL] Text on SDL

I think a popular one is sfont.

http://www.linux-games.com/sfont/

Basically the idea is that you have a file full of pre-rendered text and
you blit what you want (one letter at a time… well the library does 1
letter at a time).

You can also make bitmap data structures in your code (or include them!)
but this has problems on a few platforms (think Mac OS classic).

Jesse

-----Original Message-----
From: carlosvra@mevran.com.ar (Carlos Vrancken)
To: sdl at libsdl.org
Date: Tue, 20 May 2003 12:38:18 -0500
Subject: Re: [SDL] Text on SDL

Hmmm… and what are those ways to draw text? is there any documentation
about it?

Thanks!!

Carlos

On Tue, 2003-05-20 at 11:58, Bob Pendleton wrote:

On Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Hi! I’m seeing a discussion on the SDL_ttf library, which I have not

used (yet?).

Is this library the only way to write text on a SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces from true type font
(.ttf) files. You can then blit those to another SDL surface to draw
text.

  Bob Pendleton

Thanks,

Carlos


Carlos Vrancken


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

Hmmm… and what are those ways to draw text? is there any
documentation about it?

I guess I am missing something because your question does not make sense
to me in this context. As I said, you are free to use any technique you
chose to draw text. Any good text book on computer graphics will explain
the basics of drawing pixels into a buffer. How you choose to use that
ability it entirely up to you. SDL place no restrictions on your ability
to modify pixels in a buffer.

	Bob PendletonOn Tue, 2003-05-20 at 12:38, Carlos Vrancken wrote:

Thanks!!

Carlos

On Tue, 2003-05-20 at 11:58, Bob Pendleton wrote:

On Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Hi! I’m seeing a discussion on the SDL_ttf library, which I have not
used (yet?).

Is this library the only way to write text on a SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces from true type font
(.ttf) files. You can then blit those to another SDL surface to draw
text.

  Bob Pendleton

Thanks,

Carlos

Carlos Vrancken

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

I have another simple question on this topic. Were can
I find truetype font files, or do I already have them?
I am using Linux if that matters.

Thanks,
Rafik
— Bob Pendleton wrote: > On
Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:> > Hi! I’m seeing a discussion on the SDL_ttf

library, which I have not

used (yet?).

Is this library the only way to write text on a
SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces
from true type font
(.ttf) files. You can then blit those to another SDL
surface to draw
text.

  Bob Pendleton

Thanks,

Carlos

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

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


Post your free ad now! http://personals.yahoo.ca

There are countless places on the web to download TrueType Fonts.
Most of them have restrictions on distribution. And sadly, a lot of
the font websites (e.g., the ones with far too many animated GIFs hosted
on Geocities accounts) don’t even take the distribution restrictions into
account when they throw them on their site.

In fact, I’ve seen tons of sites which contain just the fonts, and no
other documentation or copyright information. (Like they extracted 100s of
ZIP files and then deleted everything but the TTF files. >:^( )

Anyway, the point is, you’ll need to be careful with what you use, if you
plan on distributing it as part of some game or other software package.
(Regardless as to whether you’re Open-Source-ing your code, too.)

As for finding any TrueTypes sitting on your own Linux box, try something
like:

locate .ttf

It’ll show every file on your box that has “.ttf” somewhere in the name.
(Notice there’s no “*”, by the way. You can add that, but if your shell
happens to notice a TTF file in the directory you’re in when you run the
command, it’ll just search for files with the same name. ;^)
BTW, you can run ‘locate’ from anywhere, and it’ll show you all files
in all directories, not just what’s under your current directory.)

Some free fonts I’ve used recently include:

I’ve also used some free Chinese, Greek, Japanese and Koren fonts.

Good luck!

-bill!On Tue, May 20, 2003 at 03:35:04PM -0400, Rafik Rezzik wrote:

I have another simple question on this topic. Were can
I find truetype font files, or do I already have them?
I am using Linux if that matters.


bill at newbreedsoftware.com Hire me!
http://newbreedsoftware.com/bill/ http://newbreedsoftware.com/bill/resume/

Bob Pendleton wrote

Hmmm… and what are those ways to draw text? is there any
documentation about it?

I guess I am missing something because your question does not make sense
to me in this context. As I said, you are free to use any technique you
chose to draw text. Any good text book on computer graphics will explain
the basics of drawing pixels into a buffer. How you choose to use that
ability it entirely up to you. SDL place no restrictions on your ability
to modify pixels in a buffer.

  Bob Pendleton

Bob…

He probably took your statement (“SDL allows you to draw text
any way you choose”) as meaning that there were several standard
ways to handle text and wanted to get info about them. At least,
he was probably hoping there were standard ways to do it. :slight_smile:

I’m pretty new to this stuff, too, and after searching for ways
to render text in OpenGL, I was surprised that there was no
standard or even built-in way to do it, but I did find some
tutorials with sample code for a couple methods (bitmapped
and textured fonts). I’ll probably be writing my own routine
based on what I found, but that seems a bit shameful in our
day, considering how common font rendering is. :wink:

-Chris> On Tue, 2003-05-20 at 12:38, Carlos Vrancken wrote:

Thanks!!

Carlos

On Tue, 2003-05-20 at 11:58, Bob Pendleton wrote:

On Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Hi! I’m seeing a discussion on the SDL_ttf library, which I have not
used (yet?).

Is this library the only way to write text on a SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces from true type font
(.ttf) files. You can then blit those to another SDL surface to draw
text.

  Bob Pendleton

Thanks,

Carlos

Carlos Vrancken

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

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

Bob Pendleton wrote

Hmmm… and what are those ways to draw text? is there any
documentation about it?

I guess I am missing something because your question does not make sense
to me in this context. As I said, you are free to use any technique you
chose to draw text. Any good text book on computer graphics will explain
the basics of drawing pixels into a buffer. How you choose to use that
ability it entirely up to you. SDL place no restrictions on your ability
to modify pixels in a buffer.

  Bob Pendleton

Bob…

He probably took your statement (“SDL allows you to draw text
any way you choose”) as meaning that there were several standard
ways to handle text and wanted to get info about them. At least,
he was probably hoping there were standard ways to do it. :slight_smile:

Sure, that makes sense. And, if he is new to the list he wouldn’t know
that this is a bi-weekly discussion. The most common ways to draw text
under OpenGL are to use something like the FTGL library, the old PEX and
Hershey stroke fonts, or to use a true type font library, such as Free
Type (which SDL_TTF) is based on. The following is a link to a long
story I posted a couple of months ago about drawing text in OpenGL.
http://www.libsdl.org/pipermail/sdl/2003-April/053837.html

I’m pretty new to this stuff, too, and after searching for ways
to render text in OpenGL, I was surprised that there was no
standard or even built-in way to do it, but I did find some
tutorials with sample code for a couple methods (bitmapped
and textured fonts). I’ll probably be writing my own routine
based on what I found, but that seems a bit shameful in our
day, considering how common font rendering is. :wink:

Libraries like SDL and OpenGL are not intended to be a swiss army knife
with a bell and a whistle and a tweezer to meet every need. They are
tools that allow you to build the bells and whistles and tweezers that
you want. Anyway, there are dozens of OpenGL font libraries out there. A
search on Google gets you to
http://www.opengl.org/developers/code/features/fontsurvey/ which covers
the ground pretty thoroughly.

	Bob PendletonOn Tue, 2003-05-20 at 20:47, Chris Palmer wrote:

On Tue, 2003-05-20 at 12:38, Carlos Vrancken wrote:

-Chris

Thanks!!

Carlos

On Tue, 2003-05-20 at 11:58, Bob Pendleton wrote:

On Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Hi! I’m seeing a discussion on the SDL_ttf library, which I have not
used (yet?).

Is this library the only way to write text on a SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces from true type font
(.ttf) files. You can then blit those to another SDL surface to draw
text.

  Bob Pendleton

Thanks,

Carlos

Carlos Vrancken

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

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


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

±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

I used in windows a software named font2bitmap or something else, where
i can make truetype font to bmp files. i use that for my mini game
zpong. so i use know linux, is there a software that is similar to the
font2bmp ? if not i must write my own software.

Rafik Rezzik schrieb:> I have another simple question on this topic. Were can

I find truetype font files, or do I already have them?
I am using Linux if that matters.

Thanks,
Rafik
— Bob Pendleton wrote: > On
Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Hi! I’m seeing a discussion on the SDL_ttf

library, which I have not

used (yet?).

Is this library the only way to write text on a

SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces
from true type font
(.ttf) files. You can then blit those to another SDL
surface to draw
text.

 Bob Pendleton

Thanks,

Carlos


±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

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


Post your free ad now! http://personals.yahoo.ca


Ihre bevorzugten Shops, hilfreiche Einkaufs-Hilfen und gro?artige
Geschenk Ideen. Erleben Sie das Vergn?gen online einzukaufen mit
Shop at Netscape! http://shopping.netscape.de/shopping/

I used in windows a software named font2bitmap or something else, where
i can make truetype font to bmp files. i use that for my mini game
zpong. so i use know linux, is there a software that is similar to the
font2bmp ? if not i must write my own software.

Rafik Rezzik schrieb:> I have another simple question on this topic. Were can

I find truetype font files, or do I already have them?
I am using Linux if that matters.

Thanks,
Rafik
— Bob Pendleton wrote: > On
Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Hi! I’m seeing a discussion on the SDL_ttf

library, which I have not

used (yet?).

Is this library the only way to write text on a

SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces
from true type font
(.ttf) files. You can then blit those to another SDL
surface to draw
text.

  Bob Pendleton

Thanks,

Carlos


±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

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


Post your free ad now! http://personals.yahoo.ca

u can try use gimp, as a plugin that make it (sfont)> ----- Original Message -----

From: ferhat_ziba@gmx.de (Ferhat Ziba)
Newsgroups: loki.open-source.sdl
To:
Sent: Monday, June 16, 2003 10:32 AM
Subject: Re: [SDL] Text on SDL

I used in windows a software named font2bitmap or something else, where
i can make truetype font to bmp files. i use that for my mini game
zpong. so i use know linux, is there a software that is similar to the
font2bmp ? if not i must write my own software.

Rafik Rezzik schrieb:

I have another simple question on this topic. Were can
I find truetype font files, or do I already have them?
I am using Linux if that matters.

Thanks,
Rafik
— Bob Pendleton wrote: > On
Tue, 2003-05-20 at 10:38, Carlos Vrancken wrote:

Hi! I’m seeing a discussion on the SDL_ttf

library, which I have not

used (yet?).

Is this library the only way to write text on a

SDL display?

No. SDL allows you to draw text any way you chose.

SDL_ttf is a library for generating SDL surfaces
from true type font
(.ttf) files. You can then blit those to another SDL
surface to draw
text.

Bob Pendleton

Thanks,

Carlos


±----------------------------------+

  • Bob Pendleton: independent writer +
  • and programmer. +
  • email: Bob at Pendleton.com +
    ±----------------------------------+

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


Post your free ad now! http://personals.yahoo.ca


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

I would imagine you could just copy the bmp files over to your Linux
box, no need to run a separate conversion as far as I can see.

-Justin

blackmoslemE at netscape.net 6/16/2003 9:34:43 AM >>>
I used in windows a software named font2bitmap or something else, where

i can make truetype font to bmp files. i use that for my mini game
zpong. so i use know linux, is there a software that is similar to the

font2bmp ? if not i must write my own software.