replace QFreetypeFace::getSfntTable() with its body

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-12-24 13:05:10 +02:00
parent 2da0286b27
commit 56ed1cddd5
2 changed files with 9 additions and 15 deletions

View file

@ -306,19 +306,6 @@ QFontEngine::Properties QFreetypeFace::properties() const
return p; return p;
} }
bool QFreetypeFace::getSfntTable(uint tag, uchar *buffer, uint *length) const
{
bool result = false;
#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) > 20103
if (FT_IS_SFNT(face)) {
FT_ULong len = *length;
result = FT_Load_Sfnt_Table(face, tag, 0, buffer, &len) == FT_Err_Ok;
*length = len;
}
#endif
return result;
}
/* Some fonts (such as MingLiu rely on hinting to scale different /* Some fonts (such as MingLiu rely on hinting to scale different
components to their correct sizes. While this is really broken (it components to their correct sizes. While this is really broken (it
should be done in the component glyph itself, not the hinter) we should be done in the component glyph itself, not the hinter) we
@ -956,7 +943,15 @@ QFixed QFontEngineFT::emSquareSize() const
bool QFontEngineFT::getSfntTableData(uint tag, uchar *buffer, uint *length) const bool QFontEngineFT::getSfntTableData(uint tag, uchar *buffer, uint *length) const
{ {
return freetype->getSfntTable(tag, buffer, length); bool result = false;
#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) > 20103
if (FT_IS_SFNT(freetype->face)) {
FT_ULong len = *length;
result = FT_Load_Sfnt_Table(freetype->face, tag, 0, buffer, &len) == FT_Err_Ok;
*length = len;
}
#endif
return result;
} }
int QFontEngineFT::synthesized() const int QFontEngineFT::synthesized() const

View file

@ -60,7 +60,6 @@ class QFreetypeFace
public: public:
void computeSize(const QFontDef &fontDef, int *xsize, int *ysize, bool *outline_drawing); void computeSize(const QFontDef &fontDef, int *xsize, int *ysize, bool *outline_drawing);
QFontEngine::Properties properties() const; QFontEngine::Properties properties() const;
bool getSfntTable(uint tag, uchar *buffer, uint *length) const;
static QFreetypeFace *getFace(const QFontEngine::FaceId &face_id); static QFreetypeFace *getFace(const QFontEngine::FaceId &face_id);
void release(const QFontEngine::FaceId &face_id); void release(const QFontEngine::FaceId &face_id);