Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/gui/text/freetype/qfontengine_ft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags,
static inline bool areMetricsTooLarge(const QFontEngineFT::GlyphInfo &info)
{
// false if exceeds QFontEngineFT::Glyph metrics
return info.width > 0xFF || info.height > 0xFF || info.linearAdvance > 0x7FFF;
return info.width > 0xFF || info.height > 0xFF;
}

static inline void transformBoundingBox(int *left, int *top, int *right, int *bottom, FT_Matrix *matrix)
Expand Down Expand Up @@ -1874,7 +1874,6 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
info.height = TRUNC(top - bottom);

// If any of the metrics are too large to fit, don't cache them
// Also, avoid integer overflow when linearAdvance is to large to fit in a signed short
if (areMetricsTooLarge(info))
return nullptr;

Expand Down
2 changes: 1 addition & 1 deletion src/gui/text/qfontengine_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Q_GUI_EXPORT QFontEngine
struct Glyph {
Glyph() = default;
~Glyph() { delete [] data; }
short linearAdvance = 0;
int linearAdvance = 0;
unsigned short width = 0;
unsigned short height = 0;
short x = 0;
Expand Down