Skip to content

Commit 4923af6

Browse files
committed
Fontin Small Caps and Italic Version
1 parent afa8221 commit 4923af6

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

engine/render.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ enum r_fontAlign_e {
2626

2727
// Fonts
2828
enum r_fonts_e {
29-
F_FIXED, // Monospaced: Bitsteam Vera Sans Mono
30-
F_VAR, // Normal: Liberation Sans
31-
F_VAR_BOLD, // Normal: Liberation Sans Bold
29+
F_FIXED, // Monospaced: Bitsteam Vera Sans Mono
30+
F_VAR, // Normal: Liberation Sans
31+
F_VAR_BOLD, // Normal: Liberation Sans Bold
32+
F_FONTIN_SC, // Normal: Fontin Small Caps
33+
F_FONTIN_SC_ITALIC, // Normal: Fontin Small Caps Italic
34+
F_FONTIN_ITALIC, // Normal: Fontin Italic
3235
F_NUMFONTS
3336
};
3437

engine/render/r_main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,9 @@ void r_renderer_c::Init(r_featureFlag_e features)
10891089
fonts[F_FIXED] = new r_font_c(this, "Bitstream Vera Sans Mono");
10901090
fonts[F_VAR] = new r_font_c(this, "Liberation Sans");
10911091
fonts[F_VAR_BOLD] = new r_font_c(this, "Liberation Sans Bold");
1092+
fonts[F_FONTIN_SC] = new r_font_c(this, "Fontin SmallCaps");
1093+
fonts[F_FONTIN_SC_ITALIC] = new r_font_c(this, "Fontin SmallCaps Italic");
1094+
fonts[F_FONTIN_ITALIC] = new r_font_c(this, "Fontin Italic");
10921095

10931096
sys->con->Printf("Renderer initialised in %d msec.\n", timer.Get());
10941097
}

ui_api.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
** SetDrawColor(red, green, blue[, alpha]) / SetDrawColor("<escapeStr>")
6262
** DrawImage({imgHandle|nil}, left, top, width, height[, tcLeft, tcTop, tcRight, tcBottom][, stackIdx[, maskIdx]]) maskIdx: use a stack layer as multiplicative mask
6363
** DrawImageQuad({imgHandle|nil}, x1, y1, x2, y2, x3, y3, x4, y4[, s1, t1, s2, t2, s3, t3, s4, t4][, stackIdx[, maskIdx]])
64-
** DrawString(left, top, align{"LEFT"|"CENTER"|"RIGHT"|"CENTER_X"|"RIGHT_X"}, height, font{"FIXED"|"VAR"|"VAR BOLD"}, "<text>")
65-
** width = DrawStringWidth(height, font{"FIXED"|"VAR"|"VAR BOLD"}, "<text>")
66-
** index = DrawStringCursorIndex(height, font{"FIXED"|"VAR"|"VAR BOLD"}, "<text>", cursorX, cursorY)
64+
** DrawString(left, top, align{"LEFT"|"CENTER"|"RIGHT"|"CENTER_X"|"RIGHT_X"}, height, font{"FIXED"|"VAR"|"VAR BOLD"|"FONTIN SC"|"FONTIN SC ITALIC"|"FONTIN ITALIC"}, "<text>")
65+
** width = DrawStringWidth(height, font{"FIXED"|"VAR"|"VAR BOLD"|"FONTIN SC"|"FONTIN SC ITALIC|"FONTIN ITALIC"}, "<text>")
66+
** index = DrawStringCursorIndex(height, font{"FIXED"|"VAR"|"VAR BOLD"|"FONTIN SC"|"FONTIN SC ITALIC|"FONTIN ITALIC"}, "<text>", cursorX, cursorY)
6767
** str = StripEscapes("<string>")
6868
** count = GetAsyncCount()
6969
**
@@ -1060,7 +1060,7 @@ static int l_DrawString(lua_State* L)
10601060
ui->LAssert(L, lua_isstring(L, 5), "DrawString() argument 5: expected string, got %s", luaL_typename(L, 5));
10611061
ui->LAssert(L, lua_isstring(L, 6), "DrawString() argument 6: expected string, got %s", luaL_typename(L, 6));
10621062
static const char* alignMap[6] = { "LEFT", "CENTER", "RIGHT", "CENTER_X", "RIGHT_X", NULL };
1063-
static const char* fontMap[4] = { "FIXED", "VAR", "VAR BOLD", NULL };
1063+
static const char* fontMap[7] = { "FIXED", "VAR", "VAR BOLD", "FONTIN SC", "FONTIN SC ITALIC", "FONTIN ITALIC", NULL};
10641064
ui->renderer->DrawString(
10651065
(float)lua_tonumber(L, 1), (float)lua_tonumber(L, 2), luaL_checkoption(L, 3, "LEFT", alignMap),
10661066
(int)lua_tointeger(L, 4), NULL, luaL_checkoption(L, 5, "FIXED", fontMap), lua_tostring(L, 6)
@@ -1077,7 +1077,7 @@ static int l_DrawStringWidth(lua_State* L)
10771077
ui->LAssert(L, lua_isnumber(L, 1), "DrawStringWidth() argument 1: expected number, got %s", luaL_typename(L, 1));
10781078
ui->LAssert(L, lua_isstring(L, 2), "DrawStringWidth() argument 2: expected string, got %s", luaL_typename(L, 2));
10791079
ui->LAssert(L, lua_isstring(L, 3), "DrawStringWidth() argument 3: expected string, got %s", luaL_typename(L, 3));
1080-
static const char* fontMap[4] = { "FIXED", "VAR", "VAR BOLD", NULL };
1080+
static const char* fontMap[7] = { "FIXED", "VAR", "VAR BOLD", "FONTIN SC", "FONTIN SC ITALIC", "FONTIN ITALIC", NULL };
10811081
lua_pushinteger(L, ui->renderer->DrawStringWidth((int)lua_tointeger(L, 1), luaL_checkoption(L, 2, "FIXED", fontMap), lua_tostring(L, 3)));
10821082
return 1;
10831083
}
@@ -1093,7 +1093,7 @@ static int l_DrawStringCursorIndex(lua_State* L)
10931093
ui->LAssert(L, lua_isstring(L, 3), "DrawStringCursorIndex() argument 3: expected string, got %s", luaL_typename(L, 3));
10941094
ui->LAssert(L, lua_isnumber(L, 4), "DrawStringCursorIndex() argument 4: expected number, got %s", luaL_typename(L, 4));
10951095
ui->LAssert(L, lua_isnumber(L, 5), "DrawStringCursorIndex() argument 5: expected number, got %s", luaL_typename(L, 5));
1096-
static const char* fontMap[4] = { "FIXED", "VAR", "VAR BOLD", NULL };
1096+
static const char* fontMap[7] = { "FIXED", "VAR", "VAR BOLD", "FONTIN SC", "FONTIN SC ITALIC", "FONTIN ITALIC", NULL };
10971097
lua_pushinteger(L, ui->renderer->DrawStringCursorIndex((int)lua_tointeger(L, 1), luaL_checkoption(L, 2, "FIXED", fontMap), lua_tostring(L, 3), (int)lua_tointeger(L, 4), (int)lua_tointeger(L, 5)) + 1);
10981098
return 1;
10991099
}

0 commit comments

Comments
 (0)