Bug 680460

Summary: Not respecting lcdfilter/subpixeling fontconfig settings
Product: [Fedora] Fedora Reporter: Tomáš Bžatek <tbzatek>
Component: libreofficeAssignee: Caolan McNamara <caolanm>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: caolanm, dtardon, ltinkl, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: poppler-0.16.3-1.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-28 23:55:52 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
Screenshot of LibreOffice
none
Screenshot of gedit
none
pic of results none

Description Tomáš Bžatek 2011-02-25 11:25:07 EST
Created attachment 481027 [details]
Screenshot of LibreOffice

Description:
Libreoffice doesn't respect fontconfig settings and renders fonts differently than other apps.

-- this is a followup for upstream https://bugzilla.gnome.org/show_bug.cgi?id=640133

Steps to Prepare:
First, you need to enable FT_CONFIG_OPTION_SUBPIXEL_RENDERING define in
freetype sources to actually see the difference and recompile. For Gentoo, just
put '-bindist' in your USE flags. For Fedora, pass '--with subpixel_rendering'
on rpmbuild command-line or edit the spec file. I'm testing with bytecode
intepreter enabled (Fedora since freetype-2.4.4-3.fc16, Gentoo with
USE="-auto-hinter").

Then you need to set fontconfig:
 1. enable sub-pixel rendering in fontconfig, usually
/etc/fonts/conf.d/10-sub-pixel-bgr.conf
 2. set 'lcdfilter' option to 'lcddefault'
 3. set 'hinting' option to 'true' (for TrueType or for everything)
 4. set 'hintstyle' option to  'hintfull'

This could be also done via gnome 2.x control-center or by putting the
following contents in /etc/fonts/local.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
    <edit mode="assign" name="hinting">
      <bool>true</bool>
    </edit>
    <edit mode="assign" name="hintstyle">
      <const>hintfull</const>
    </edit>
  </match>
</fontconfig>


Version-Release number of selected component (if applicable):
libreoffice-core-3.3.0.4-1.fc15.x86_64

Steps to Reproduce:
1. Prepare your freetype setup, set hinting to full and lcdfilter to default
2. Run libreoffice, put some text there
3. Run some other text editor, like gedit, put some text there
4. Notice the rendering differences, namely antialiasing filtering
  
Actual results:
See libreoffice.png

Expected results:
See gedit.png

Additional info:
There were also concerns some time ago in https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/271283
Comment 1 Tomáš Bžatek 2011-02-25 11:25:29 EST
Created attachment 481028 [details]
Screenshot of gedit
Comment 3 Caolan McNamara 2011-03-01 11:59:33 EST
will fiddle with this when I get a chance
Comment 4 Caolan McNamara 2011-03-02 10:15:26 EST
Ugh, this may take some time, bgr makes me feel ill
Comment 5 Caolan McNamara 2011-03-02 15:11:22 EST
We use cairo-ft-font-face-create-for-ft-face with flags derived from the fontconfig settings + cairo_set_font defaults pulled from the gdk settings. For all this to work we probably really instead need to use cairo_ft_font_face_create_for_pattern and hold onto the original pattern + set FC_FT_FACE with the faceid we want to use.
Comment 6 Caolan McNamara 2011-03-16 11:55:59 EDT
Created attachment 485773 [details]
pic of results
Comment 7 Caolan McNamara 2011-03-16 11:57:19 EDT
changes checked in upstream for libreoffice 3.4, backported to libreoffice-3.3.1.2-10.fc15

screenshot as above is what I get now
Comment 8 Fedora Update System 2011-03-22 06:12:01 EDT
poppler-0.16.3-1.fc15,libreoffice-3.3.1.2-11.fc15,ufraw-0.18-2.fc15,vtk-5.6.1-5.fc15,apvlv-0.0.9.8-4.fc15,calibre-0.7.44-3.fc15,ease-0.4-4.fc15,epdfview-0.1.7-13.20100621svn.fc15,evince-2.91.92-2.fc15,gambas2-2.22.0-6.fc15,gdcm-2.0.16-17.fc15,gimp-2.6.11-8.fc15,gloobus-preview-0.4.1-13.fc15,gnome-commander-1.2.8.10-3.fc15,gummi-0.5.5-4.fc15,inkscape-0.48.1-4.fc15,koffice-2.3.3-2.fc15,libextractor-0.6.2-1508.fc15,OpenSceneGraph-2.8.3-10.fc15,pdf2djvu-0.7.4-7.fc15,pdf2svg-0.2.1-11.fc15,pypoppler-0.12.1-11.fc15,referencer-1.1.6-15.fc15,rubygem-poppler-0.90.8-2.fc15,texlive-2007-62.fc15,texmaker-2.1-5.fc15,texmakerx-2.0-6.fc15,tracker-0.10.3-2.fc15,vifir-0.8-1.fc15,xournal-0.4.5-12.fc15,zathura-0.0.8.2-5.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/poppler-0.16.3-1.fc15,libreoffice-3.3.1.2-11.fc15,ufraw-0.18-2.fc15,vtk-5.6.1-5.fc15,apvlv-0.0.9.8-4.fc15,calibre-0.7.44-3.fc15,ease-0.4-4.fc15,epdfview-0.1.7-13.20100621svn.fc15,evince-2.91.92-2.fc15,gambas2-2.22.0-6.fc15,gdcm-2.0.16-17.fc15,gimp-2.6.11-8.fc15,gloobus-preview-0.4.1-13.fc15,gnome-commander-1.2.8.10-3.fc15,gummi-0.5.5-4.fc15,inkscape-0.48.1-4.fc15,koffice-2.3.3-2.fc15,libextractor-0.6.2-1508.fc15,OpenSceneGraph-2.8.3-10.fc15,pdf2djvu-0.7.4-7.fc15,pdf2svg-0.2.1-11.fc15,pypoppler-0.12.1-11.fc15,referencer-1.1.6-15.fc15,rubygem-poppler-0.90.8-2.fc15,texlive-2007-62.fc15,texmaker-2.1-5.fc15,texmakerx-2.0-6.fc15,tracker-0.10.3-2.fc15,vifir-0.8-1.fc15,xournal-0.4.5-12.fc15,zathura-0.0.8.2-5.fc15
Comment 9 Fedora Update System 2011-03-23 09:22:21 EDT
libreoffice-3.3.2.2-2.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/libreoffice-3.3.2.2-2.fc15
Comment 10 Fedora Update System 2011-03-28 23:55:37 EDT
libreoffice-3.3.2.2-2.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2011-03-28 23:57:19 EDT
poppler-0.16.3-1.fc15, ufraw-0.18-2.fc15, vtk-5.6.1-5.fc15, apvlv-0.0.9.8-4.fc15, calibre-0.7.44-3.fc15, ease-0.4-4.fc15, epdfview-0.1.7-13.20100621svn.fc15, gdcm-2.0.16-17.fc15, gimp-2.6.11-8.fc15, gloobus-preview-0.4.1-13.fc15, gnome-commander-1.2.8.10-3.fc15, gummi-0.5.5-4.fc15, inkscape-0.48.1-4.fc15, koffice-2.3.3-2.fc15, libextractor-0.6.2-1508.fc15, OpenSceneGraph-2.8.3-10.fc15, pdf2djvu-0.7.4-7.fc15, pdf2svg-0.2.1-11.fc15, pypoppler-0.12.1-11.fc15, referencer-1.1.6-15.fc15, rubygem-poppler-0.90.8-2.fc15, texlive-2007-62.fc15, texmaker-2.1-5.fc15, vifir-0.8-1.fc15, xournal-0.4.5-12.fc15, zathura-0.0.8.2-5.fc15, gambas2-2.22.0-7.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.