SDL_ttf

Hello Guys!

How hard is to port the SDL_ttf library to the MacOS?

Thanks!

Eduardo.

“Eduardo B. Fonseca” wrote:

Hello Guys!

How hard is to port the SDL_ttf library to the MacOS?

Thanks!

I guess it mainly depends on freetype (the truetype font rendering
library) beeing available for MacOS.
Quoting from www.freetype.org:

Written in portable ANSI C (and Pascal, for FT 1). Should compile well on all kinds of systems (tested on
16, 32 and 64 bits processors). With full source code available.

Eduardo.

regards,–
Karsten-O. Laux Lehrstuhl Digitialtechnik
@Karsten-O_Laux Fachbereich
Tel: 0631-205-4683 Elektrotechnik und Informationstechnik
Universit?t Kaiserslautern

Hello Guys,

I've never used this lib... can you guys help me? I'm having some

trouble with it… How do I compile my program to use it? How do I use
this lib?

Thanks!

Eduardo B. Fonseca
ebf at cwb.fnn.net

WARNING: Signature in Portuguese!

“As pessoas que acham que sabem de tudo irritam a todos… principalmente
a nos, que realmente sabemos tudo…” - Anonimo

“Dica no. 7 de pilotagem: Quando estiver em duvida, mantenha sua altitude.
Ninguem nunca bateu no ar.” - Anonimo

Hi!

    I've never used this lib... can you guys help me? I'm having some

trouble with it… How do I compile my program to use it? How do I use
this lib?

Go to:

http://www.libsdl.org/

You’ll find some tutorials to this.

cu
G?nther–
±------------------------------+
| .~. |
| / V \ |
| /( )\ |
±------------^^-^^-------------+
| @gnoack_at_guentherno |
| http://www.guenthernoack.de |
±------------------------------+
| F?R BANNERTAUSCH iMMER BEREiT |
±------------------------------+

Hi,

are you guys thinking of an update of SDL_ttf library? FreeType2 has more
cool features which would be very useful for programmers, like Scaling,
Rotation and other transformations…

Also will be great to get a character as vector object, ie. list of
primitives :slight_smile:

regards, Pavel Kanzelsberger

are you guys thinking of an update of SDL_ttf library? FreeType2 has more
cool features which would be very useful for programmers, like Scaling,
Rotation and other transformations…

The latest version of SDL_ttf has support for FreeType 2, but it doesn’t
expose the advanced features. If you want those, you’re probably better
off looking at SDL_ttf and then writing your own code (or proposing an
extension to SDL_ttf)

Also will be great to get a character as vector object, ie. list of
primitives :slight_smile:

Yeah, you definitely want to use FreeType directly.
That’s really beyond the scope of SDL_ttf, which is meant as a convenience
library to help get text onto a surface.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Well OK, but atleast transformations will help for many SDL projects :slight_smile:

Oh, anyway do you if there is binary compiled FreeType2 library or I need to
use C sources? Problem is that I’m not using C language…

Regards, Pavel Kanzelsberger> ----- Original Message -----

From: Sam Lantinga [mailto:slouken@devolution.com]
Sent: Monday, March 25, 2002 6:45 PM
To: sdl at libsdl.org
Subject: Re: [SDL] SDL_ttf

are you guys thinking of an update of SDL_ttf library? FreeType2 has
more cool features which would be very useful for programmers, like
Scaling, Rotation and other transformations…

The latest version of SDL_ttf has support for FreeType 2, but it doesn’t
expose the advanced features. If you want those, you’re probably better off
looking at SDL_ttf and then writing your own code (or proposing an extension
to SDL_ttf)

Also will be great to get a character as vector object, ie. list of
primitives :slight_smile:

Yeah, you definitely want to use FreeType directly.
That’s really beyond the scope of SDL_ttf, which is meant as a convenience
library to help get text onto a surface.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


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

How I can remove anti-aliasing for texts when I using SDL_ttf library?
Why I can’t get any text output when I init VideoMode with full screen flag
and without hwsurface?
does SDL_ttf works only in hwsurface mode?

marex

Are you doing SDL_Flip between drawing frames?On Mon, 2002-11-18 at 15:32, marex wrote:

How I can remove anti-aliasing for texts when I using SDL_ttf library?
Why I can’t get any text output when I init VideoMode with full screen flag
and without hwsurface?
does SDL_ttf works only in hwsurface mode?

No, I don’t. I just took some sample from this mailing list - some kind of text
rendering on SDL_Surface and Blink that surface on screen. I don’t do any
SDL_Flip calls.

marex> On Mon, 2002-11-18 at 15:32, marex wrote:

How I can remove anti-aliasing for texts when I using SDL_ttf library?
Why I can’t get any text output when I init VideoMode with full screen
flag
and without hwsurface?
does SDL_ttf works only in hwsurface mode?

Are you doing SDL_Flip between drawing frames?


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

How I can remove anti-aliasing for texts when I using SDL_ttf library?

Using anti-aliasing or not depends on the call you use to draw the text,
TTF_RenderText_Solid - will render the text with no anti-aliasing,
simulated or otherwise. This may be what you’re looking for.

TTF_RenderText_Shaded - will blend a forground an background colour to
look anti-aliased without using an alpha channel,

TTF_RenderText_Blended - will create a true alpha channeled anti-alias.

To learn how to make these calls properly you should check out the
SDL_ttf.h file. It has basic documentation in it.

Why I can’t get any text output when I init VideoMode with full screen flag
and without hwsurface?
does SDL_ttf works only in hwsurface mode?

SDL_ttf returns surfaces that can be blitted onto any surface, hardware,
software… it doesn’t matter. What it sounds like is that you have to
do some studying on SDL_UpdateRect and/or SDL_Flip.

There are some fundamental concepts there that you’ll need to understand
before you’ll be able to effectively do anything with SDL.

Check out the reference at http://sdldoc.csn.ul.ie/

…and you might want to skim a basic tutorial like
http://www.libsdl.org/intro/usingvideo.htmlOn Mon, 2002-11-18 at 16:32, marex wrote:

marex


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

Jimmy <@Jimmy>
Jimmy’s World.org
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20021119/56a24222/attachment.pgp

Hi everyone
Where Can I get info about SDL_ttf?
Thanks_________________________________________________________
?Te Crees Muy Cool?
X-volution.com El Portal Para Chavos. Entra Ya
http://x-volution.com

“Maynard Humpries” wrote:

Where Can I get info about SDL_ttf?

the header file is documented well. ask special questions here.

clemens

i’m really sick of this.

can anyone tell me how i can build sdl_ttf for mingw32.

or is there an another lib that i can use to load ttf fonts with SDL------------------------------------------------------------------
Virus taramasi Vexira AV programi kullanilarak Is Net tarafindan yapilmistir.
This e-mail is checked by Is Net against all known types of viruses using Vexira AV.
Is Net’in en ucuz saatlik kullanim paketi Teneffus.Net’i ve en ucuz sinirsiz erisim paketi Taksitli Ekonet’i duymus muydunuz?
http://www.isnet.net.tr/teneffusnet/
http://www.isnet.net.tr/taksitliekonet/

I can only say it’s a real PITA to make sdl_ttf work under cygwin for
me. So, I abandoned that environment for Dev-C++ and included
SDL+SDL_ttf in the installation. But I cant promise you the latest and
the greatest version though. But I have it working in Win2K Pro and
linux (wow!).

If you really wanna build it, maybe you could check out who has built it
for Dev-C++ and mail that guy for some tip, if possible?

my 0.02 euro

/Patrich

m?n 2003-04-21 klockan 20.02 skrev COSKU BAS:> i’m really sick of this.

can anyone tell me how i can build sdl_ttf for mingw32.

or is there an another lib that i can use to load ttf fonts with SDL


Virus taramasi Vexira AV programi kullanilarak Is Net tarafindan yapilmistir.
This e-mail is checked by Is Net against all known types of viruses using Vexira AV.
Is Net’in en ucuz saatlik kullanim paketi Teneffus.Net’i ve en ucuz sinirsiz erisim paketi Taksitli Ekonet’i duymus muydunuz?
http://www.isnet.net.tr/teneffusnet/
http://www.isnet.net.tr/taksitliekonet/

Patrich Bj?rklund <@Patrich_Bjorklund>
Home Factory

I’m trying to find a way to display fixed-width text in an SDL app. I
assume SDL_ttf is the tool for this, but I can’t find any truetype, fixed
width, free fonts. Will SDL_ttf load formats other than .ttf? Am I missing
some obvious font which I should be able to find everywhere? What do
people use when they need text in SDL?

–oberon

oberon wrote:

I’m trying to find a way to display fixed-width text in an SDL app. I
assume SDL_ttf is the tool for this, but I can’t find any truetype, fixed
width, free fonts.

Try harder. I just googled and found these (in less than 2 minutes):

http://www.highfonts.com/fontsearch.asp?f=0&ord=mono
http://www.1001fonts.com/fonts_overview.html?page=1&category_id=7

For example you have Arial Monospaced, and this one looks really good:
http://www.1001fonts.com/fonts/win/ttf/1136/unispace.zip

Will SDL_ttf load formats other than .ttf?

AFAIK, no.

Am I missing
some obvious font which I should be able to find everywhere?

Probably.

What do people use when they need text in SDL?

I have my fonts which are single row of letter images in one .bmp file.
And I have small Font class that does loading and rendering on
SDL_Surfaces. (You can grab the source from Njam CVS, files are
njamfont.cpp and njamfont.h). Many people do it that way.–
Milan Babuskov
http://njam.sourceforge.net

Documentation for SDL_ttf seems a it lacking so I am stabbing the the
dark here, and from the demo and documentation I was able to scrap
together this for initializing SDL_ttf, but it crashes and burns
every-time:

[Code]

TTF_Font *font
char *filename

// This works
if( TTF_Init() == -1 ) {
fprintf(stderr, “Unable to initialize SDL_TTF: %s\n”, TTF_GetError());
return 1;
}

// This is where it burns
filename = FreeMono.ttf";
font = TTF_OpenFont(filename, 9);
if( font == NULL ) {
fprintf(stderr, “Unable to open default TTF font: %s\n”,
TTF_GetError());
return 1;
}

[/Code]—
Coleman Nitroy
nitroy.com/cole

// This is where it burns
filename = FreeMono.ttf";

i assume the lack of leading " is a typo in the e-mail …

font = TTF_OpenFont(filename, 9);

is the ttf in the same directory you ran the test app from ?
-mikeOn Friday 16 April 2004 12:08 am, Coleman Nitroy wrote:

I think you got the good point.

I’ve disvoered some month ago, that TTF_Font did not return NULL or do a
godd work if the file did not exist.

Example from my debug log, when I have specified in my configuration file a
font file that did not exist :

— 2150 [DEBUG]ADDING FONT data/fonts/nadi?a.TTF (52) to the List
— Fatal signal: Segmentation Fault (SDL Parachute Deployed)

The thing is to add a personal check for font existance by default because
TTF_OpenFont seems to not do it.

Oh and if you’re planning a linux version, do not use TTF_RenderText_Solid,
because this function did not work on linux so I’m using
SDL_RenderText_Shaded and then set the colorkey of the surface. This is not
perfect but this is a work around.

Wedge

-----Message d’origine-----
De?: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] De la part de Mike
Frysinger
Envoy??: vendredi 16 avril 2004 08:24
??: sdl at libsdl.org
Objet?: Re: [SDL] SDL_ttf

// This is where it burns
filename = FreeMono.ttf";

i assume the lack of leading " is a typo in the e-mail …

font = TTF_OpenFont(filename, 9);

is the ttf in the same directory you ran the test app from ?
-mikeOn Friday 16 April 2004 12:08 am, Coleman Nitroy wrote:


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