diff -urN qt/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp qt2/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp --- qt/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp 2018-06-15 09:29:31.000000000 +0200 +++ qt2/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp 2018-09-18 16:55:58.385475999 +0200 @@ -66,7 +66,9 @@ #include FT_TYPE1_TABLES_H #include FT_GLYPH_H #include FT_MODULE_H +#if FREETYPE_MAJOR >= 2 && FREETYPE_MINOR >= 3 #include FT_LCD_FILTER_H +#endif #if defined(FT_CONFIG_OPTIONS_H) #include FT_CONFIG_OPTIONS_H @@ -777,7 +779,10 @@ default_load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; default_hint_style = ftInitialDefaultHintStyle; subpixelType = Subpixel_None; + lcdFilterType = 0; +#if FREETYPE_MAJOR >= 2 && FREETYPE_MINOR >= 3 lcdFilterType = (int)((quintptr) FT_LCD_FILTER_DEFAULT); +#endif defaultFormat = Format_None; embeddedbitmap = false; const QByteArray env = qgetenv("QT_NO_FT_CACHE"); @@ -1162,6 +1167,7 @@ int glyph_buffer_size = 0; QScopedArrayPointer glyph_buffer; +#if FREETYPE_MAJOR >= 2 && FREETYPE_MINOR >= 3 bool useFreetypeRenderGlyph = false; if (slot->format == FT_GLYPH_FORMAT_OUTLINE && (hsubpixel || vfactor != 1)) { err = FT_Library_SetLcdFilter(slot->library, (FT_LcdFilter)lcdFilterType); @@ -1190,7 +1196,9 @@ convertRGBToARGB(slot->bitmap.buffer, (uint *)glyph_buffer.data(), info.width, info.height, slot->bitmap.pitch, subpixelType != Subpixel_RGB, false); else if (vfactor != 1) convertRGBToARGB_V(slot->bitmap.buffer, (uint *)glyph_buffer.data(), info.width, info.height, slot->bitmap.pitch, subpixelType != Subpixel_VRGB, false); - } else { + } else +#endif + { int left = slot->metrics.horiBearingX; int right = slot->metrics.horiBearingX + slot->metrics.width; int top = slot->metrics.horiBearingY; @@ -1257,7 +1265,9 @@ Q_ASSERT(antialias); uchar *convoluted = new uchar[bitmap_buffer_size]; bool useLegacyLcdFilter = false; +#if FREETYPE_MAJOR >= 2 && FREETYPE_MINOR >= 3 useLegacyLcdFilter = (lcdFilterType == FT_LCD_FILTER_LEGACY); +#endif uchar *buffer = bitmap.buffer; if (!useLegacyLcdFilter) { convoluteBitmap(bitmap.buffer, convoluted, bitmap.width, info.height, bitmap.pitch);