Search code examples
clinuxfont-sizeallegroallegro5

How can I increase the size of the displayed text using a library like Allegro? C


How can I change the size of the displayed font to display the following entry:

al_draw_textf(font, al_map_rgb(204, 255, 255), WIDTH / 2, 50,\
              ALLEGRO_ALIGN_CENTER, "%d : %d", pl1.scope, pl2.scope);

Created a standard ASCII font which I am trying to resize.

ALLEGRO_FONT* font = al_create_builtin_font();

Display of the players' score. (img)

This is the first game, I didn't do anything except console programs before.



Solution

    1. As al_create_builtin_font() - liballeg points out:

    ALLEGRO_FONT *al_create_builtin_font(void)

    Creates a monochrome bitmap font (8x8 pixels per character).

    This font is primarily intended to be used for displaying information in environments or during early runtime states where no external font data is available or loaded (e.g. for debugging).

    1. In order to resize fonts load fonts from the local/system repo.

    al_load_font() :

    ALLEGRO_FONT *al_load_font(char const *filename, int size, int flags)
    
    1. Package your fonts with the game, it becomes easier to load them.