diff options
Diffstat (limited to 'src/font.cpp')
| -rw-r--r-- | src/font.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/font.cpp b/src/font.cpp index 3204f58..9ca42c5 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -149,7 +149,7 @@ float FontType_Inner_LookAheadLineCount(const FontType *const ft, const FontRend return ret; } -void FontType_Inner_CalcTransforms(const FontType *ft, FontRender *fr, FontInstanceBufferItem *ptr_dst) { +bool FontType_Inner_CalcTransforms(const FontType *ft, FontRender *fr, FontInstanceBufferItem *ptr_dst) { assert(ft != nullptr); assert(fr != nullptr); assert(ptr_dst != nullptr); @@ -163,6 +163,10 @@ void FontType_Inner_CalcTransforms(const FontType *ft, FontRender *fr, FontInsta glm::vec3 translate; glm::vec3 scale; + if (PK_HAS_FLAG(FONT_RENDER_FLAG_T(fr->settings.flags), FONT_RENDER_FLAG_T(FONT_RENDER_FLAG_VISIBILITY_INVISIBLE))) { + return false; + } + // TODO 2025-04-10 - JCB PERF // consider adding early-out when we exceed the bounding-box limits. @@ -313,6 +317,7 @@ void FontType_Inner_CalcTransforms(const FontType *ft, FontRender *fr, FontInsta (fr->settings.char_scale / ft->msdf_settings.minimum_scale) * ft->msdf_settings.px_range; } + return true; } void FontType_Init() { @@ -415,8 +420,9 @@ void FontType_Tick(double delta) { for (FontRenderIndex_T k = 0; k < (FontRenderIndex_T)ft->n_render; ++k) { if ((ft->unused_frs & (1llu << k)) != 0) continue; fr = &ft->renders[k]; - FontType_Inner_CalcTransforms(ft, fr, &fibis[index]); - index += fr->n_glyphs; + if (FontType_Inner_CalcTransforms(ft, fr, &fibis[index])) { + index += fr->n_glyphs; + } } // check recreate buffer |
