#include "examples_common.c"

int main(void)
{
    allegro_init();

    my_setup_screen();
    
    FUDGEFONT_INFO info;
    fudgefont_info(&info);

    install_keyboard();
    install_timer();
    install_fudgefont();

    clear_to_color(screen, makecol(255, 255, 255));

    FONT *f = my_load_font("ttf/DejaVuSans.ttf", 40);
    FONT *f2 = my_load_font("ttf/DejaVuSans.ttf", 20);
    FONT *fk, *fk2;
    
    if (info.kerning)
    {
        fudgefont_set_kerning(1);
        fk = my_load_font("ttf/DejaVuSans.ttf", 40);
        fk2 = my_load_font("ttf/DejaVuSans.ttf", 20);
    }

    /* Print something. */
    my_color(100, 0, 0);
    my_print(f, 320, 50, 1, "(no kerning)");
    my_print(f, 320, 100, 1, "Tulip Turnip Turtle");
    my_color(0, 0, 200);
    my_print(f2, 320, 100 + text_height(f), 1,
        "Fudging Truetype fonts into Allegro..");

    if (info.kerning)
    {
        /* Now with kerning. */
        my_color(100, 0, 0);
        my_print(fk, 320, 250, 1, "(with kerning)");
        my_print(fk, 320, 300, 1, "Tulip Turnip Turtle");
        my_color(0, 0, 200);
        my_print(fk2, 320, 300 + text_height(f), 1,
            "Fudging Truetype fonts into Allegro..");
    }
    else
    {
        my_color(255, 0, 0);
        my_print(f2, 320, 250, 1, "The used FudgeFont library");
        my_print(f2, 320, 250 + text_height(f2), 1, "was compiled without kerning support!");
    }

    my_flip();
    readkey();
    return 0;
}
END_OF_MAIN()
