Version: (using Devel) Installed from: Compiled sources Here is a patch from a Mandriva contributor fixing the Freetype LCD filtering support for subpixel rendering in Antialiasing settings dialog can i commit it upstream ? Changelog: Do not check for Freetype LCD filtering support for subpixel rendering in Antialiasing settings dialog. KDE uses QT4 code for subpixel rendering, so it works independently from Freetype LCD filtering support. Index: kdebase-workspace-4.1.3/ConfigureChecks.cmake =================================================================== --- kdebase-workspace-4.1.3/ConfigureChecks.cmake +++ kdebase-workspace-4.1.3/ConfigureChecks.cmake 2008-12-24 20:36:53.000000000 +0200 @@ -63,7 +63,6 @@ check_include_files("sys/types.h;sys/statfs.h" HAVE_SYS_STATFS_H) check_function_exists(statfs HAVE_STATFS) macro_bool_to_01(FONTCONFIG_FOUND HAVE_FONTCONFIG) # kcontrol/{fonts,kfontinst} -macro_bool_to_01(FREETYPE_FOUND HAVE_FREETYPE) # kcontrol/fonts macro_bool_to_01(OPENGL_FOUND HAVE_OPENGL) # kwin macro_bool_to_01(X11_XShm_FOUND HAVE_XSHM) # kwin, ksplash macro_bool_to_01(X11_XTest_FOUND HAVE_XTEST) # khotkeys, kxkb, kdm Index: kdebase-workspace-4.1.3/config-workspace.h.cmake =================================================================== --- kdebase-workspace-4.1.3/config-workspace.h.cmake +++ kdebase-workspace-4.1.3/config-workspace.h.cmake 2008-12-24 20:39:36.000000000 +0200 @@ -12,9 +12,6 @@ /* Defines if your system has the libfontconfig library */ #cmakedefine HAVE_FONTCONFIG 1 -/* Defines if your system has the freetype library */ -#cmakedefine HAVE_FREETYPE 1 - /* Define if you have gethostname */ #cmakedefine HAVE_GETHOSTNAME 1 Index: kdebase-workspace-4.1.3/kcontrol/fonts/fonts.cpp =================================================================== --- kdebase-workspace-4.1.3/kcontrol/fonts/fonts.cpp +++ kdebase-workspace-4.1.3/kcontrol/fonts/fonts.cpp 2008-12-24 20:35:40.000000000 +0200 @@ -41,14 +41,6 @@ #include <kdebug.h> -#ifdef HAVE_FREETYPE -#include <ft2build.h> -#ifdef FT_LCD_FILTER_H -#include FT_FREETYPE_H -#include FT_LCD_FILTER_H -#endif -#endif - #include <X11/Xlib.h> #include <QX11Info> @@ -456,19 +448,6 @@ excludeTo->setEnabled(excludeRange->isChecked()); excludeToLabel->setEnabled(excludeRange->isChecked()); subPixelType->setEnabled(useSubPixel->isChecked()); -#ifdef FT_LCD_FILTER_H - static int ft_has_subpixel = -1; - if( ft_has_subpixel == -1 ) { - FT_Library ftLibrary; - if(FT_Init_FreeType(&ftLibrary) == 0) { - ft_has_subpixel = ( FT_Library_SetLcdFilter(ftLibrary, FT_LCD_FILTER_DEFAULT ) - == FT_Err_Unimplemented_Feature ) ? 0 : 1; - FT_Done_FreeType(ftLibrary); - } - } - useSubPixel->setEnabled(ft_has_subpixel); - subPixelType->setEnabled(ft_has_subpixel); -#endif } #endif
What this patch do ? The real LCD filtering / antialiasing bug was in Qt4, but it's going to be improved on Qt4.5. Take a look at: http://labs.trolltech.com/blogs/2008/09/01/subpixel-antialiasing-on-x11/
(I'm the original author of the patch) KDE4 checks that Freetype has LCD subpixel rendering support before allowing user to enable it. However, QT4 has independent LCD subpixel rendering support (src/gui/text/qfontengine_ft.cpp) which works no matter if Freetype has it or not. The patch removes the check, allowing the user to enable subpixel rendering in all cases.
Thanks for the explanation :)
Is this bug still present when using Qt 4.5? Is the patch still needed?
Yes and yes. (Note that the subject of this bug report is wrong; As per my comment above, the bug is that KDE checks for Freetype LCD filtering support while it is *not* actually relevant, as QT4 has its own filtering implementation)
Anssi (or Nicolas), can you commit? As far as I can see (I don't know freetype internals that much), the patch in comment #0 looks good. There is only one thing that I am not sure about: You remove the HAVE_FREETYPE define from the config file. You should make sure it isn't needed by any other module. If it is not, you should also remove (or comment out) the checks for freetype in the CMakeLists.txt, and maybe contact kde-buildsystem mailing list about that change. Thanks!
(sorry for the delay) There are no other users of HAVE_FREETYPE in kdebase-workspace. However, freetype is still needed by kfontinst, which is why I didn't remove the check. I don't have KDE commit access; Nicolas, can you commit?
Created attachment 66999 [details] Do not check for Freetype LCD rendering availability Attached patch against current git master.
Is this still needed with Qt 5?
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
Looks like it is still needed.
*** This bug has been marked as a duplicate of bug 378504 ***