|
Loading of .fon files. |
Desmond Taylor
Member #11,943
May 2010
|
I am trying to load MS Sans Serif but it seems to not render correctly. Here is the code used. 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 Edit 2: Now I cannot change the size :/ |
weapon_S
Member #7,859
October 2006
|
You mean loading fails for another size? I don't know what a fon file is. |
Desmond Taylor
Member #11,943
May 2010
|
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
Member #2,030
March 2002
|
Desmond Taylor said: It's a windows font file. Windows 3.1 font. I believe it's a bitmap font format. -- |
torhu
Member #2,727
September 2002
|
You could try loading the TTF version instead, micross.ttf. |
Desmond Taylor
Member #11,943
May 2010
|
, I didn't know there was a ttf version. Going to look for it now and report back to you. Edit: Works perfectly thanks |
torhu
Member #2,727
September 2002
|
|