Pixel-Composer/scripts/font_loader/font_loader.gml

30 lines
1008 B
Plaintext
Raw Normal View History

2022-11-03 11:44:49 +01:00
globalvar FONT_LOADED, f_h3, f_h5, f_p0, f_p0b, f_p1, f_p2, f_p3;
FONT_LOADED = false;
2022-11-01 03:06:03 +01:00
function loadFonts() {
2022-11-03 11:44:49 +01:00
if(FONT_LOADED) {
font_delete(f_h3);
font_delete(f_h5);
font_delete(f_p0);
font_delete(f_p0b);
font_delete(f_p1);
font_delete(f_p2);
font_delete(f_p3);
}
2022-11-01 03:06:03 +01:00
var font = "NotoSans";
2022-11-03 11:44:49 +01:00
f_h3 = font_add("data/fonts/" + font + "-Bold.ttf", 20 * UI_SCALE, false, false, 32, 127);
f_h5 = font_add("data/fonts/" + font + "-Bold.ttf", 16 * UI_SCALE, false, false, 32, 127);
2022-11-01 03:06:03 +01:00
2022-11-03 11:44:49 +01:00
f_p0 = font_add("data/fonts/" + font + "-Medium.ttf", 12 * UI_SCALE, false, false, 32, 127);
f_p0b = font_add("data/fonts/" + font + "-Bold.ttf", 12 * UI_SCALE, false, false, 32, 127);
2022-11-01 03:06:03 +01:00
2022-11-03 11:44:49 +01:00
f_p1 = font_add("data/fonts/" + font + "-SemiBold.ttf", 11 * UI_SCALE, false, false, 32, 127);
f_p2 = font_add("data/fonts/" + font + "-SemiBold.ttf", 10 * UI_SCALE, false, false, 32, 127);
f_p3 = font_add("data/fonts/" + font + "-SemiBold.ttf", 9 * UI_SCALE, false, false, 32, 127);
FONT_LOADED = true;
2022-11-01 03:06:03 +01:00
}