Loading of .fon files.
Desmond Taylor

I am trying to load MS Sans Serif but it seems to not render correctly.

Here is the code used.

#SelectExpand
1#include <allegro5/allegro.h> 2#include <allegro5/allegro_font.h> 3#include <allegro5/allegro_ttf.h> 4 5int main( int argc, char** argv ) 6{ 7 al_init(); 8 al_init_font_addon(); 9 al_init_ttf_addon(); 10 11 ALLEGRO_DISPLAY* display = al_create_display( 640, 480 ); 12 13 ALLEGRO_FONT* font = al_load_font( "sserife.fon", 12, 0 ); 14 15 al_draw_text( font, al_map_rgb( 255, 255, 255 ), 10, 10, 0, "This is a test" ); 16 17 al_flip_display(); 18 19 al_rest( 2 ); 20 21 al_destroy_font( font ); 22 23 al_shutdown_font_addon(); 24 al_shutdown_ttf_addon(); 25 26 al_destroy_display( display ); 27 28 return 0; 29}

I have also attached the executable.

Does anyone know what this happens?

Edit: I've fixed it using ALLEGRO_TTF_MONOCHROME in the al_load_font function :D

Edit 2: Now I cannot change the size :/

weapon_S

You mean loading fails for another size? I don't know what a fon file is.

Desmond Taylor

It's a windows font file. It loads but the size will not change it's loading really small. Readable but I need it bigger. I really don't want to use a similar font but will use Verdana or Arial if needed.

gnolam

It's a windows font file.

Windows 3.1 font. I believe it's a bitmap font format. :P

torhu

You could try loading the TTF version instead, micross.ttf.

Desmond Taylor

;D, I didn't know there was a ttf version. Going to look for it now and report back to you.

Edit: Works perfectly thanks :D

torhu

Cool :)

Thread #608034. Printed from Allegro.cc