How do I get a larger text size and different fonts?
blargmob

Howdy,

How do I get a larger text size and different fonts? I don't like the default font in allegro, so how do I load and/or make new fonts for allegro that I can use? And how do I make a font bigger?
???

Onewing
type568

I had such a Q too.. what i didn't get there is how to modify the sizes.. or it must be a lrage font itself? :S

Kikaru

It must be a large font itself. I have considered making something to handle scaling, though I don't know how well it would work...

blargmob

So how do I make a .fnt file?
???

ImLeftFooted
Quote:

How do I get a larger text size and different fonts? I don't like the default font in allegro, so how do I load and/or make new fonts for allegro that I can use? And how do I make a font bigger?

Allegro is not a font library. If you want to manipulate fonts use a font library.

Matthew Leverton
blargmob

Wait a minute...... I tried calling load_font() and it didn't work.....it said the function didn't exist....

Matthew Leverton

Use version 4.2.1.

blargmob

Okay, I got 4.2.1 but now my compiler returns a warning that says that some functions are "deprecated". What does that meen?

BAF

You need to use textprintf_ex, textout_ex, etc now that the older ones are deprecated. It's just a warning, meaning that those functions aren't supposed to be used anymore and could be removed at anytime.

Matthew Leverton

It means that they have been replaced with something better and might go away in the future (like in 1,000 years).

blargmob

Okay thanks.

Kirr

You can also try Glyph Keeper. It can load TTF fonts and render text or create Allegro FONTs from them. It can render angled, italic, bold, translucent, antialiased fonts, etc.. Full list of features is here. :)

James Stanley

You could also scale the font by code (I did this for the menu screen of my current game. Then I replaced the code generated one with a bitmap).

blargmob

I loaded a font with

FONT *myfont;
myfont = load_font("myfont.pcx",NULL,NULL);

What do I do next?

Onewing
Quote:

What do I do next?

Use it?

blargmob

I tried doing this

FONT *myfont;
myfont = load_font("myfont.pcx",NULL,NULL);

textout_ex(screen,myfont,"Stuff",0,0,makecol(255,255,255),-1);

but it didn't work... am I missing a step? (or 2)

Kitty Cat

Define 'didn't work'.

blargmob

When I launched the exe file it crashed in an instant. What's wrong?

Onewing
Quote:

What's wrong?

Let me guess...something.

Kitty Cat

Maybe trying to use a NULL pointer for the font. Did you check to make sure load_font actually succeeded?

blargmob

I fixed. Ha ha. Stupid problem, I accidentely loaded the file with the wrong name.

Thread #590430. Printed from Allegro.cc