1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0025691: Visualization, TKService - fix font corruption on FreeType 2.5.4

This commit is contained in:
kgv 2015-01-07 23:29:06 +03:00 committed by bugmaster
parent c857a60abe
commit 49297cb6bd
2 changed files with 4 additions and 4 deletions

View File

@ -160,7 +160,7 @@ bool Font_FTFont::RenderGlyph (const Standard_Utf32Char theUChar)
FT_Bitmap aBitmap = myFTFace->glyph->bitmap; FT_Bitmap aBitmap = myFTFace->glyph->bitmap;
if (aBitmap.pixel_mode != FT_PIXEL_MODE_GRAY if (aBitmap.pixel_mode != FT_PIXEL_MODE_GRAY
|| aBitmap.buffer == NULL || aBitmap.width <= 0 || aBitmap.rows <= 0) || aBitmap.buffer == NULL || aBitmap.width == 0 || aBitmap.rows == 0)
{ {
return false; return false;
} }

View File

@ -171,11 +171,11 @@ public:
//! Retrieve glyph bitmap rectangle //! Retrieve glyph bitmap rectangle
inline void GlyphRect (Font_FTFont::Rect& theRect) const inline void GlyphRect (Font_FTFont::Rect& theRect) const
{ {
FT_Bitmap aBitmap = myFTFace->glyph->bitmap; const FT_Bitmap& aBitmap = myFTFace->glyph->bitmap;
theRect.Left = float(myFTFace->glyph->bitmap_left); theRect.Left = float(myFTFace->glyph->bitmap_left);
theRect.Top = float(myFTFace->glyph->bitmap_top); theRect.Top = float(myFTFace->glyph->bitmap_top);
theRect.Right = float(myFTFace->glyph->bitmap_left + aBitmap.width); theRect.Right = float(myFTFace->glyph->bitmap_left + (int )aBitmap.width);
theRect.Bottom = float(myFTFace->glyph->bitmap_top - aBitmap.rows); theRect.Bottom = float(myFTFace->glyph->bitmap_top - (int )aBitmap.rows);
} }
protected: protected: