diff --git a/include/QF/ui/font.h b/include/QF/ui/font.h index ab526a8ab..6ea183d6d 100644 --- a/include/QF/ui/font.h +++ b/include/QF/ui/font.h @@ -51,6 +51,7 @@ typedef struct font_s { FT_Long num_glyphs; vrect_t *glyph_rects; vec2i_t *glyph_bearings; + uint32_t fontid; } font_t; void Font_Init (void); diff --git a/libs/ruamoko/rua_gui.c b/libs/ruamoko/rua_gui.c index b9ef12e2f..95a25be51 100644 --- a/libs/ruamoko/rua_gui.c +++ b/libs/ruamoko/rua_gui.c @@ -60,7 +60,7 @@ bi (Font_Load) QFile *font_file = QFS_FOpenFile (font_path); font_t *font = Font_Load (font_file, font_size); - R_INT (pr) = r_funcs->Draw_AddFont (font); + R_INT (pr) = font->fontid; } bi (Font_String) diff --git a/libs/ui/font.c b/libs/ui/font.c index 29e6704f0..afb293670 100644 --- a/libs/ui/font.c +++ b/libs/ui/font.c @@ -36,6 +36,8 @@ #include "QF/sys.h" #include "QF/math/bitop.h" +#include "QF/plugin/vid_render.h" + #include "QF/ui/font.h" #include "compat.h" @@ -131,6 +133,7 @@ Font_Load (QFile *font_file, int size) copy_glyph (rect, slot, font); } + font->fontid = r_funcs->Draw_AddFont (font); return font; } diff --git a/libs/ui/text.c b/libs/ui/text.c index 5b65a64ea..0177f38d4 100644 --- a/libs/ui/text.c +++ b/libs/ui/text.c @@ -165,6 +165,7 @@ Text_View (font_t *font, passage_t *passage) .glyphid = glyphid, .x = xp + bearing[0], .y = yp - bearing[1], + .fontid = font->fontid, }; x += xa; y += ya;