Search
j0ke.net Open Build Service
>
Projects
>
internetx
:
1351100200
:
1001689948
>
opt-libqt4
> use-freetype-default.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File use-freetype-default.diff of Package opt-libqt4
Index: src/gui/text/qfontengine_x11.cpp =================================================================== --- src/gui/text/qfontengine_x11.cpp 2011/10/27 14:22:22 1.1 +++ src/gui/text/qfontengine_x11.cpp 2011/10/27 14:22:32 @@ -967,6 +967,26 @@ *antialias = b; } +#include <ft2build.h> +#include FT_FREETYPE_H +#include FT_LCD_FILTER_H + +static bool subpixel_rendering_available() +{ + static int implemented = -1; + + if (implemented >= 0) + return implemented; + + extern FT_Library qt_getFreetype(); + FT_Library lib = qt_getFreetype(); + + if (FT_Err_Unimplemented_Feature == + FT_Library_SetLcdFilter(lib, FT_LCD_FILTER_DEFAULT )) + return (implemented = false); + + return (implemented = true); +} QFontEngineX11FT::QFontEngineX11FT(FcPattern *pattern, const QFontDef &fd, int screen) : QFontEngineFT(fd) @@ -984,7 +1004,7 @@ canUploadGlyphsToServer = QApplication::testAttribute(Qt::AA_X11InitThreads) || (qApp->thread() == QThread::currentThread()); subpixelType = Subpixel_None; - if (antialias) { + if (subpixel_rendering_available() && antialias) { int subpixel = X11->display ? X11->screens[screen].subpixel : FC_RGBA_UNKNOWN; if (subpixel == FC_RGBA_UNKNOWN) (void) FcPatternGetInteger(pattern, FC_RGBA, 0, &subpixel);