Bug 180305 - Fix Freetype LCD filtering support
Summary: Fix Freetype LCD filtering support
Status: RESOLVED DUPLICATE of bug 378504
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_fonts (show other bugs)
Version: unspecified
Platform: Compiled Sources Unspecified
: NOR normal
Target Milestone: ---
Assignee: rik
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2009-01-11 01:25 UTC by Nicolas L.
Modified: 2020-04-24 16:37 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Do not check for Freetype LCD rendering availability (3.58 KB, patch)
2011-12-21 20:31 UTC, Anssi Hannula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas L. 2009-01-11 01:25:03 UTC
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
Comment 1 Dario Andres 2009-01-11 01:38:03 UTC
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/
Comment 2 Anssi Hannula 2009-01-11 01:46:23 UTC
(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.
Comment 3 Dario Andres 2009-01-11 01:48:48 UTC
Thanks for the explanation :)
Comment 4 Christoph Feck 2009-05-09 21:13:14 UTC
Is this bug still present when using Qt 4.5? Is the patch still needed?
Comment 5 Anssi Hannula 2009-05-09 21:26:09 UTC
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)
Comment 6 Christoph Feck 2009-05-11 19:50:28 UTC
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!
Comment 7 Anssi Hannula 2009-07-19 10:27:31 UTC
(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?
Comment 8 Anssi Hannula 2011-12-21 20:31:22 UTC
Created attachment 66999 [details]
Do not check for Freetype LCD rendering availability

Attached patch against current git master.
Comment 9 Nate Graham 2018-06-18 18:38:00 UTC
Is this still needed with Qt 5?
Comment 10 Andrew Crouthamel 2018-09-28 03:08:27 UTC
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!
Comment 11 Nate Graham 2018-09-30 20:27:42 UTC
Looks like it is still needed.
Comment 12 Nate Graham 2020-04-24 16:37:39 UTC

*** This bug has been marked as a duplicate of bug 378504 ***