Browse Source

Change TTF init asserts to warns and add some details to the output (#2681)

Co-authored-by: Raziel Alphadios <[email protected]>
Raziel Alphadios 4 years ago
parent
commit
16ee93b88d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/common/font/font_manager.cpp

+ 2 - 2
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);