diff --git a/engine/render.h b/engine/render.h index 3506504..6f19795 100644 --- a/engine/render.h +++ b/engine/render.h @@ -26,9 +26,12 @@ enum r_fontAlign_e { // Fonts enum r_fonts_e { - F_FIXED, // Monospaced: Bitsteam Vera Sans Mono - F_VAR, // Normal: Liberation Sans - F_VAR_BOLD, // Normal: Liberation Sans Bold + F_FIXED, // Monospaced: Bitsteam Vera Sans Mono + F_VAR, // Normal: Liberation Sans + F_VAR_BOLD, // Normal: Liberation Sans Bold + F_FONTIN_SC, // Normal: Fontin Small Caps + F_FONTIN_SC_ITALIC, // Normal: Fontin Small Caps Italic + F_FONTIN_ITALIC, // Normal: Fontin Italic F_NUMFONTS }; diff --git a/engine/render/r_main.cpp b/engine/render/r_main.cpp index 480c323..93cad0a 100644 --- a/engine/render/r_main.cpp +++ b/engine/render/r_main.cpp @@ -1089,6 +1089,9 @@ void r_renderer_c::Init(r_featureFlag_e features) fonts[F_FIXED] = new r_font_c(this, "Bitstream Vera Sans Mono"); fonts[F_VAR] = new r_font_c(this, "Liberation Sans"); fonts[F_VAR_BOLD] = new r_font_c(this, "Liberation Sans Bold"); + fonts[F_FONTIN_SC] = new r_font_c(this, "Fontin SmallCaps"); + fonts[F_FONTIN_SC_ITALIC] = new r_font_c(this, "Fontin SmallCaps Italic"); + fonts[F_FONTIN_ITALIC] = new r_font_c(this, "Fontin Italic"); sys->con->Printf("Renderer initialised in %d msec.\n", timer.Get()); } diff --git a/ui_api.cpp b/ui_api.cpp index 166c9d6..657b470 100644 --- a/ui_api.cpp +++ b/ui_api.cpp @@ -62,9 +62,9 @@ ** SetDrawColor(red, green, blue[, alpha]) / SetDrawColor("") ** DrawImage({imgHandle|nil}, left, top, width, height[, tcLeft, tcTop, tcRight, tcBottom][, stackIdx[, maskIdx]]) maskIdx: use a stack layer as multiplicative mask ** DrawImageQuad({imgHandle|nil}, x1, y1, x2, y2, x3, y3, x4, y4[, s1, t1, s2, t2, s3, t3, s4, t4][, stackIdx[, maskIdx]]) -** DrawString(left, top, align{"LEFT"|"CENTER"|"RIGHT"|"CENTER_X"|"RIGHT_X"}, height, font{"FIXED"|"VAR"|"VAR BOLD"}, "") -** width = DrawStringWidth(height, font{"FIXED"|"VAR"|"VAR BOLD"}, "") -** index = DrawStringCursorIndex(height, font{"FIXED"|"VAR"|"VAR BOLD"}, "", cursorX, cursorY) +** DrawString(left, top, align{"LEFT"|"CENTER"|"RIGHT"|"CENTER_X"|"RIGHT_X"}, height, font{"FIXED"|"VAR"|"VAR BOLD"|"FONTIN SC"|"FONTIN SC ITALIC"|"FONTIN ITALIC"}, "") +** width = DrawStringWidth(height, font{"FIXED"|"VAR"|"VAR BOLD"|"FONTIN SC"|"FONTIN SC ITALIC|"FONTIN ITALIC"}, "") +** index = DrawStringCursorIndex(height, font{"FIXED"|"VAR"|"VAR BOLD"|"FONTIN SC"|"FONTIN SC ITALIC|"FONTIN ITALIC"}, "", cursorX, cursorY) ** str = StripEscapes("") ** count = GetAsyncCount() ** @@ -1068,7 +1068,7 @@ static int l_DrawString(lua_State* L) ui->LAssert(L, lua_isstring(L, 5), "DrawString() argument 5: expected string, got %s", luaL_typename(L, 5)); ui->LAssert(L, lua_isstring(L, 6), "DrawString() argument 6: expected string, got %s", luaL_typename(L, 6)); static const char* alignMap[6] = { "LEFT", "CENTER", "RIGHT", "CENTER_X", "RIGHT_X", NULL }; - static const char* fontMap[4] = { "FIXED", "VAR", "VAR BOLD", NULL }; + static const char* fontMap[7] = { "FIXED", "VAR", "VAR BOLD", "FONTIN SC", "FONTIN SC ITALIC", "FONTIN ITALIC", NULL}; const float dpiScale = ui->renderer->VirtualScreenScaleFactor(); const float left = lua_tonumber(L, 1) * dpiScale; const float top = lua_tonumber(L, 2) * dpiScale; @@ -1101,7 +1101,7 @@ static int l_DrawStringWidth(lua_State* L) ui->LAssert(L, lua_isnumber(L, 1), "DrawStringWidth() argument 1: expected number, got %s", luaL_typename(L, 1)); ui->LAssert(L, lua_isstring(L, 2), "DrawStringWidth() argument 2: expected string, got %s", luaL_typename(L, 2)); ui->LAssert(L, lua_isstring(L, 3), "DrawStringWidth() argument 3: expected string, got %s", luaL_typename(L, 3)); - static const char* fontMap[4] = { "FIXED", "VAR", "VAR BOLD", NULL }; + static const char* fontMap[7] = { "FIXED", "VAR", "VAR BOLD", "FONTIN SC", "FONTIN SC ITALIC", "FONTIN ITALIC", NULL }; const float dpiScale = ui->renderer->VirtualScreenScaleFactor(); const lua_Number logicalHeight = lua_tonumber(L, 1); int scaledHeight = static_cast(std::lround(logicalHeight * dpiScale)); @@ -1131,7 +1131,7 @@ static int l_DrawStringCursorIndex(lua_State* L) ui->LAssert(L, lua_isstring(L, 3), "DrawStringCursorIndex() argument 3: expected string, got %s", luaL_typename(L, 3)); ui->LAssert(L, lua_isnumber(L, 4), "DrawStringCursorIndex() argument 4: expected number, got %s", luaL_typename(L, 4)); ui->LAssert(L, lua_isnumber(L, 5), "DrawStringCursorIndex() argument 5: expected number, got %s", luaL_typename(L, 5)); - static const char* fontMap[4] = { "FIXED", "VAR", "VAR BOLD", NULL }; + static const char* fontMap[7] = { "FIXED", "VAR", "VAR BOLD", "FONTIN SC", "FONTIN SC ITALIC", "FONTIN ITALIC", NULL }; const lua_Number logicalHeight = lua_tonumber(L, 1); const lua_Number logicalCursorX = lua_tonumber(L, 4); const lua_Number logicalCursorY = lua_tonumber(L, 5);