//
// Font loading. Sized relative to window height so the UI scales sanely on
// resize. Called from app_init() and on window-resize.
//

FONT_DIR  :: "data/fonts";
FONT_FILE :: "OpenSans-BoldItalic.ttf";

init_fonts :: () {
    h := app.window_height;
    app.title_font  = Simp.get_font_at_size(FONT_DIR, FONT_FILE, h / 8);
    app.big_font    = Simp.get_font_at_size(FONT_DIR, FONT_FILE, h / 18);
    app.row_font    = Simp.get_font_at_size(FONT_DIR, FONT_FILE, h / 24);
    app.button_font = Simp.get_font_at_size(FONT_DIR, FONT_FILE, h / 32);
    app.body_font   = Simp.get_font_at_size(FONT_DIR, FONT_FILE, h / 40);

    if !app.title_font  log_error("font load failed: %", FONT_FILE);
}
