From 16ee93b88d7ec056a4cc5a7a7d9679af1e8cfefe Mon Sep 17 00:00:00 2001 From: Raziel Alphadios <64050682+RazielXYZ@users.noreply.github.com> Date: Thu, 9 Dec 2021 00:27:13 +0200 Subject: [PATCH] Change TTF init asserts to warns and add some details to the output (#2681) Co-authored-by: Raziel Alphadios --- examples/common/font/font_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/common/font/font_manager.cpp b/examples/common/font/font_manager.cpp index 5259eafba..066408778 100644 --- a/examples/common/font/font_manager.cpp +++ b/examples/common/font/font_manager.cpp @@ -71,8 +71,8 @@ TrueTypeFont::~TrueTypeFont() bool TrueTypeFont::init(const uint8_t* _buffer, uint32_t _bufferSize, int32_t _fontIndex, uint32_t _pixelHeight, int16_t _widthPadding, int16_t _heightPadding) { - BX_ASSERT( (_bufferSize > 256 && _bufferSize < 100000000), "TrueType buffer size is suspicious"); - BX_ASSERT( (_pixelHeight > 4 && _pixelHeight < 128), "TrueType buffer size is suspicious"); + BX_WARN( (_bufferSize > 256 && _bufferSize < 100000000), "(FontIndex %d) TrueType buffer size is suspicious (%d)", _fontIndex, _bufferSize); + BX_WARN( (_pixelHeight > 4 && _pixelHeight < 128), "(FontIndex %d) TrueType pixel height is suspicious (%d)", _fontIndex, _pixelHeight); BX_UNUSED(_bufferSize); int offset = stbtt_GetFontOffsetForIndex(_buffer, _fontIndex);