mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-15 04:28:20 +00:00
Add checks for unsupported glyph pixel mode
Skip rendering glyphs which don't use the 1-byte grayscale pixel mode.
This commit is contained in:
parent
f5179df6d0
commit
a7a5c0ea7a
|
@ -510,6 +510,11 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
const FT_Bitmap *pBitmap = &Glyph.m_Face->glyph->bitmap;
|
const FT_Bitmap *pBitmap = &Glyph.m_Face->glyph->bitmap;
|
||||||
|
if(pBitmap->pixel_mode != FT_PIXEL_MODE_GRAY)
|
||||||
|
{
|
||||||
|
log_debug("textrender", "Error loading glyph, unsupported pixel mode. Chr=%d GlyphIndex=%u PixelMode=%d", Glyph.m_Chr, Glyph.m_GlyphIndex, pBitmap->pixel_mode);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const unsigned RealWidth = pBitmap->width;
|
const unsigned RealWidth = pBitmap->width;
|
||||||
const unsigned RealHeight = pBitmap->rows;
|
const unsigned RealHeight = pBitmap->rows;
|
||||||
|
@ -788,6 +793,13 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
const FT_Bitmap *pBitmap = &Face->glyph->bitmap;
|
const FT_Bitmap *pBitmap = &Face->glyph->bitmap;
|
||||||
|
if(pBitmap->pixel_mode != FT_PIXEL_MODE_GRAY)
|
||||||
|
{
|
||||||
|
log_debug("textrender", "Error loading glyph, unsupported pixel mode. Chr=%d GlyphIndex=%u PixelMode=%d", NextCharacter, GlyphIndex, pBitmap->pixel_mode);
|
||||||
|
pCurrent = pTmp;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for(unsigned OffY = 0; OffY < pBitmap->rows; ++OffY)
|
for(unsigned OffY = 0; OffY < pBitmap->rows; ++OffY)
|
||||||
{
|
{
|
||||||
for(unsigned OffX = 0; OffX < pBitmap->width; ++OffX)
|
for(unsigned OffX = 0; OffX < pBitmap->width; ++OffX)
|
||||||
|
|
Loading…
Reference in a new issue