diff options
Diffstat (limited to 'src/font.cpp')
| -rw-r--r-- | src/font.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/font.cpp b/src/font.cpp index 35db13f..bd4d530 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -491,6 +491,17 @@ FontType* FontType_Get(FontTypeIndex idx) { return &ftd.arr_ft[static_cast<FontTypeIndex_T>(idx)]; } +FontType* FontType_GetByTitle(const pk_cstr title) { + assert(title.val != nullptr); + for (FontTypeIndex_T i = 0; i < static_cast<FontTypeIndex_T>(ftd.h_ft); ++i) { + if (ftd.arr_ft[i].title.val == title.val) + return &ftd.arr_ft[i]; + if (strcmp(ftd.arr_ft[i].title.val, title.val) == 0) + return &ftd.arr_ft[i]; + } + return nullptr; +} + FontType* FontType_GetFonts(FontTypeIndex &count) { count = ftd.h_ft; return ftd.arr_ft; |
