[AD] [alleg:bugs] #380 Glitch while printing using video font

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]



[bugs:#380] Glitch while printing using video font

Status: open
Labels: al_draw_text
Created: Wed Jan 09, 2013 10:54 AM UTC by Alex Porto
Last Updated: Wed Jan 09, 2013 10:54 AM UTC
Owner: nobody

I've experiencing problems to load a font on video memory. Whenever I try to print using it, the first character of the string is skiiped and any instance of the same character inside the string will also be skipped. Printing "012034" will print " 12 34".
If the font size is bigger than 50, other characters start vanishing too, but could not figure out a pattern, since printing several strings on screen may cause different results.

This happens when using any TTF font I have, even the Windows default ones
This bug doesn't appear if the font is loeaded on memory.

This is a code to replicate it on Allegro 5.0.8:
//---------------------------------------------------------------------------

include

include allegro.h>

include allegro_image.h>

include allegro_opengl.h>

include allegro_font.h>

include allegro_ttf.h>

include allegro_primitives.h>

//---------------------------------------------------------------------------

using namespace std;

//---------------------------------------------------------------------------

int main(int argc, char * argv[])
{
al_init();
al_install_keyboard();
al_init_image_addon();
al_init_primitives_addon();
al_init_font_addon();
al_init_ttf_addon();

al_set_new_display_flags(ALLEGRO_OPENGL);
ALLEGRO_DISPLAY * mainWindow= al_create_display(1200, 1000);

ALLEGRO_PATH *path = al_get_standard_path(ALLEGRO_RESOURCES_PATH);
string file = al_path_cstr(path, '/');
file = file + "arial.ttf";
ALLEGRO_FONT * font = al_load_font(file.c_str(), 50, 0);

al_set_target_bitmap(al_get_backbuffer(mainWindow));        
al_draw_filled_rectangle(0, 0, 1200, 1000, al_map_rgb(0,0,0));

al_draw_text(font, al_map_rgb(255,0,0), 50, 50, 0, "0123045670890");

al_save_bitmap("d:\\teste.bmp", al_get_backbuffer(mainWindow));

al_flip_display();

al_rest(5.0);

return 0;

}


Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/alleg/bugs/380/

To unsubscribe from further messages, please visit https://sourceforge.net/auth/prefs/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/