subpixel rendering in intrepid

Bug #264254 reported by Joe_Bishop on 2008-09-03
50
Affects Status Importance Assigned to Milestone
cairo (Ubuntu)
Low
Unassigned

Bug Description

Latest updates degrade subpixel font rendering to the state it was before Gutsy Gibbon.
What the reason for this? Is there any chance it will return back to the same as in Hardy or previous intrepid alphas?

Related branches

Tobias Wolf (towolf) wrote :

The reason is this:

    cairo (1.7.4-0ubuntu1) intrepid; urgency=low

      * New upstream version:
    [...]
        - LCD subpixel filtering using FreeType
    [...]
      * debian/patches/00list: Remove lcd-filter patch now applied upstream

I just found out that when I add this to my .fonts.conf, then the newer LCD filter mode is used again:

    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>

The other possible values are lcdlight and lcdlegacy. I guess that lcdlegacy is now used as default, contrary to what the attribute names suggest.

Hm, well. But it is the GUI issue, and should be changeable through GUI,
not only through editing config files.

On Wed, 2008-09-03 at 09:13 +0000, Tobias Wolf wrote:
> The reason is this:
>
> cairo (1.7.4-0ubuntu1) intrepid; urgency=low
>
> * New upstream version:
> [...]
> - LCD subpixel filtering using FreeType
> [...]
> * debian/patches/00list: Remove lcd-filter patch now applied upstream
>
> I just found out that when I add this to my .fonts.conf, then the newer
> LCD filter mode is used again:
>
> <edit mode="assign" name="lcdfilter">
> <const>lcddefault</const>
> </edit>
>
> The other possible values are lcdlight and lcdlegacy. I guess that
> lcdlegacy is now used as default, contrary to what the attribute names
> suggest.
>

Bastanteroma (bastanteroma) wrote :

Isn't this confirmed, or should it be confirmed only when it's assigned?

Mark Baas (mark-baas123) wrote :

I confirm

Andreas Moog (ampelbein) wrote :

This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at https://wiki.ubuntu.com/Bugs/FindRightPackage . I have classified this bug as a bug in libcairo.

Sebastien Bacher (seb128) wrote :

Thanks for the bug report. This particular bug has already been reported, but feel free to report any other bugs you find.

Changed in libcairo:
importance: Undecided → Low
status: Confirmed → Invalid
Sebastien Bacher (seb128) wrote :

the issue is duplicate of bug #264234, closing the dup the other way around since this one as extra comments

Changed in libcairo:
status: Invalid → Confirmed
milestone: none → ubuntu-8.10-beta
Tobias Wolf (towolf) wrote :

Shouldn't this have a higher importance since it is a clear regression?

Mark Baas (mark-baas123) wrote :

I was just thinking the same

Yes, I think it should have higher importance. Because although the system
generally looks OK, but several apps like (of course!) OO looks ugly, as it
was before Hardy.

2008/9/11 Mark Baas <email address hidden>

> I was just thinking the same
>
> --
> subpixel rendering in intrepid
> https://bugs.launchpad.net/bugs/264254
> You received this bug notification because you are a direct subscriber
> of the bug.
>

The workaround of one of the dupes works:
  <match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
  </match>

in fonts.conf

I know this, but it doesn't work for the OpenOffice.org

2008/9/14 Diego Escalante Urrelo <email address hidden>

> The workaround of one of the dupes works:
> <match target="font">
> <edit mode="assign" name="lcdfilter">
> <const>lcddefault</const>
> </edit>
> </match>
>
> in fonts.conf
>
> --
> subpixel rendering in intrepid
> https://bugs.launchpad.net/bugs/264254
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Alexander Jones (alex-weej) wrote :

That's a bug in OpenOffice.org then.

OpenOffice.org is one big bug itself :D

2008/9/14 Alexander Jones <email address hidden>

> That's a bug in OpenOffice.org then.
>
> --
> subpixel rendering in intrepid
> https://bugs.launchpad.net/bugs/264254
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Mark Baas (mark-baas123) wrote :

It is not just openoffice it is also QT applications (skype) and Synaptic in sudo mode (but i guess that is because the fonts.conf is in home dir). So it is not really a good workaround. Anyhow it should get fix with priority. And it is NOT a bug in openoffice!

Tobias Wolf (towolf) wrote :

For Qt4 you have to add the lcdfilter snippet to /etc/fonts/local.conf because Qt for some reason does not look into your ~/.fonts.conf. But this will not work either because of LP bug #217729 .

I'm the guy who helped merge the lcd filtering patch upstream. Tobias analysis is right, Cairo uses the lcdlegacy filter by default if nothing is specified in the Xrm database or in the Fontconfig configuration (which is what you have from a clean Ubuntu install).
Cairo uses the lcdlegacy filter by default in order to be compatible with what it did before. This means that people using unpatched Cairo (for instance Fedora users), won't notice a difference in behavior when Cairo is updated.

However, Debian/Ubuntu have patched Cairo for some times and there is a difference between the old Debian/Ubuntu patch and what is now upstream. That difference is about what filter is used by default (oldDebian/Ubuntu patch used lcddefault by default).

What could be done to solve this issue is to modify Fontconfig configuration to use the lcddefault filter by default. This way, Ubunu/Debian users won't see a regression. I'll file a bug on Fontconfig for this.

Another option is to modify gnome-settings-daemon and gtk+ so that they can understand this new lcd filtering parameter, and change things dynamically. This would also be the first thing to do before a UI can be developed to modify the lcd filter (as Joe_Bishop mentioned in comment #2). This is not trivial to do, so I'd go the Fontconfig way first.

For people interested, I wrote a wiki page some times ago explaining the details about all of this, and what can be done next to integrate lcd filtering dynamic changes and configuration inside Gnome: http://freedesktop.org/wiki/ScreenFontSettings

bug 271088 filed. This one could be marked as a duplicate.

Mark Baas (mark-baas123) wrote :

This however doesn't explain how openoffice also lost the subpixel rendering since the cairo update. And QT also seems to act weird under gnome, however that might be other bug.

Fabien Tassin (fta) wrote :

I implemented the work-around in fontconfig as proposed by Sylvain. A preview is in my PPA as fontconfig 2.6.0-1ubuntu4~fta1 (follow my name). Seems to work fine for me. If someone else could confirm, I'll (try to) get it pushed tomorrow.

Fabien, could you give us a link?

2008/9/17 Fabien Tassin <email address hidden>

> I implemented the work-around in fontconfig as proposed by Sylvain. A
> preview is in my PPA as fontconfig 2.6.0-1ubuntu4~fta1 (follow my name).
> Seems to work fine for me. If someone else could confirm, I'll (try to)
> get it pushed tomorrow.
>
> --
> subpixel rendering in intrepid
> https://bugs.launchpad.net/bugs/264254
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Joe_Bishop,

Fabien's PPA page is on https://launchpad.net/~fta/+archive

You can grab the .deb in http://ppa.launchpad.net/fta/ubuntu/pool/main/f/fontconfig/
(For instance, install http://ppa.launchpad.net/fta/ubuntu/pool/main/f/fontconfig/libfontconfig1_2.6.0-1ubuntu4~fta1_i386.deb on i386). I'm not on Intrepid on this box, so I can't test right now.

No, it doesn't work for the OpenOffice.
I have attached an example

2008/9/17 Sylvain Pasche <email address hidden>

> Joe_Bishop,
>
> Fabien's PPA page is on https://launchpad.net/~fta/+archive<https://launchpad.net/%7Efta/+archive>
>
> You can grab the .deb in
> http://ppa.launchpad.net/fta/ubuntu/pool/main/f/fontconfig/
> (For instance, install
> http://ppa.launchpad.net/fta/ubuntu/pool/main/f/fontconfig/libfontconfig1_2.6.0-1ubuntu4~fta1_i386.deb<http://ppa.launchpad.net/fta/ubuntu/pool/main/f/fontconfig/libfontconfig1_2.6.0-1ubuntu4%7Efta1_i386.deb>on i386). I'm not on Intrepid on this box, so I can't test right now.
>
> --
> subpixel rendering in intrepid
> https://bugs.launchpad.net/bugs/264254
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Tobias Wolf (towolf) wrote :

Looks like the fix works alright. Denis, can you file a new bug on Openoffice? OO.org has also been the odd one out the last time around, and there was no way to fix it with fontconfig only.

Yes, it works OK even if there is no ~/.fonts.conf, with the exception of OO
OK, I'll file it.

2008/9/17 Tobias Wolf <email address hidden>

> Looks like the fix works alright. Denis, can you file a new bug on
> Openoffice? OO.org has also been the odd one out the last time around,
> and there was no way to fix it with fontconfig only.
>
> --
> subpixel rendering in intrepid
> https://bugs.launchpad.net/bugs/264254
> You received this bug notification because you are a direct subscriber
> of the bug.
>

https://bugs.launchpad.net/bugs/271283

2008/9/17 Я <email address hidden>

> Yes, it works OK even if there is no ~/.fonts.conf, with the exception of
> OO
> OK, I'll file it.
>
> 2008/9/17 Tobias Wolf <email address hidden>
>
> Looks like the fix works alright. Denis, can you file a new bug on
>> Openoffice? OO.org has also been the odd one out the last time around,
>> and there was no way to fix it with fontconfig only.
>>
>> --
>> subpixel rendering in intrepid
>> https://bugs.launchpad.net/bugs/264254
>> You received this bug notification because you are a direct subscriber
>> of the bug.
>>
>
>

Dan Andreșan (danyer) wrote :

ok, the initial problem raised by Joe was marked as bug 271088 and fixed 2 hours ago.
the problem with OpenOffice.org was filled as a separate bug 271283 (by Joe).

so it seems like this bug could be closed.

Do you agree Joe? As the owner you can close it (I guess).

Thanks,
Dan.

I don't know how to close, so I just make it invalid :D

Changed in cairo:
status: Confirmed → Invalid
Fabien Tassin (fta) wrote :

This bug was fixed in the package fontconfig - 2.6.0-1ubuntu4

---------------
fontconfig (2.6.0-1ubuntu4) intrepid; urgency=low

  * add debian/patches/06_ubuntu_lcddefault.patch: set lcddefault as
    default for the lcd-filter now that Cairo prefers lcdlegacy. This
    is needed to restore our previous behavior. Thanks to Sylvain Pasche.
    (LP: #271088, #264254)

 -- Fabien Tassin <email address hidden> Wed, 17 Sep 2008 00:40:14 +0200

Changed in cairo:
status: Invalid → Fix Released

But this "fix" broke antialiasing in gnome-terminal, see attached shots.
First was made in gvim, and the second in vim in terminal. I used Droid Sans
Mono 10 in both of them.
(This is just an example, I'm using Emacs with gray background and
difference is felt not so strong there :D )

2008/9/19 Fabien Tassin <email address hidden>

>
> This bug was fixed in the package fontconfig - 2.6.0-1ubuntu4
>
> ---------------
> fontconfig (2.6.0-1ubuntu4) intrepid; urgency=low
>
> * add debian/patches/06_ubuntu_lcddefault.patch: set lcddefault as
> default for the lcd-filter now that Cairo prefers lcdlegacy. This
> is needed to restore our previous behavior. Thanks to Sylvain Pasche.
> (LP: #271088, #264254)
>
> -- Fabien Tassin <email address hidden> Wed, 17 Sep 2008 00:40:14 +0200
>
>
> ** Changed in: cairo (Ubuntu)
> Status: Invalid => Fix Released
>
> --
> subpixel rendering in intrepid
> https://bugs.launchpad.net/bugs/264254
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Fabien Tassin (fta) wrote :

do you mean it was better with the same conf in ~/.fonts.conf ?

Alexander Jones (alex-weej) wrote :

Looks perfect to me, Joe. Can you explain the problem?

I have no ~/.fonts.conf

2008/9/20 Fabien Tassin <email address hidden>

> do you mean it was better with the same conf in ~/.fonts.conf ?
>
> --
> subpixel rendering in intrepid
> https://bugs.launchpad.net/bugs/264254
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Rendering in gnome-terminal doesn't seem me "perfect".
Rendering in GVIM with slight hinting which I need.
But rendering in VIM similar to full or medium hinting.

2008/9/20 Alexander Jones <email address hidden>

> Looks perfect to me, Joe. Can you explain the problem?
>
> --
> subpixel rendering in intrepid
> https://bugs.launchpad.net/bugs/264254
> You received this bug notification because you are a direct subscriber
> of the bug.
>

It is in the case when I have no ~/.fonts.conf. When I have it everything is
OK.
I suppose I shouldn't have any .fonts.conf file if I set up font settings
through Gnome gui.
Especially because in this case everything except of gnome-terminal, qt apps
and, of course, ugly sucking OO.org looks OK.

2008/9/20 Я <email address hidden>

> Rendering in gnome-terminal doesn't seem me "perfect".
> Rendering in GVIM with slight hinting which I need.
> But rendering in VIM similar to full or medium hinting.
>
> 2008/9/20 Alexander Jones <email address hidden>
>
> Looks perfect to me, Joe. Can you explain the problem?
>>
>> --
>> subpixel rendering in intrepid
>> https://bugs.launchpad.net/bugs/264254
>> You received this bug notification because you are a direct subscriber
>> of the bug.
>>
>
>

Fabien Tassin (fta) wrote :

One possible reason could be the ordering of the fontconfig rules.

/etc/fonts/conf.d/README reads:

 00 through 09 Font directories
 10 through 19 system rendering defaults (AA, etc)
 20 through 29 font rendering options
 30 through 39 family substitution
 40 through 49 generic identification, map family->generic
 50 through 59 alternate config file loading
 60 through 69 generic aliases, map generic->family
 70 through 79 select font (adjust which fonts are available)
 80 through 89 match target="scan" (modify scanned patterns)
 90 through 99 font synthesis

I used 11-lcd-filter-lcddefault.conf to match "system rendering defaults (AA, etc)"
The user ~/.fonts.conf file is loaded in 50-user.conf so one or more rules between 11 and 50 may interfere.

10-antialias.conf
10-hinting.conf
10-hinting-medium.conf
10-no-sub-pixel.conf
11-lcd-filter-lcddefault.conf
20-fix-globaladvance.conf
20-unhint-small-vera.conf
25-ttf-arphic-ukai-render.conf
25-ttf-arphic-uming-bitmaps.conf
25-ttf-arphic-uming-render.conf
30-cjk-aliases.conf
30-debconf-no-bitmaps.conf
30-defoma.conf
30-metric-aliases.conf
30-urw-aliases.conf
35-ttf-arphic-ukai-aliases.conf
35-ttf-arphic-uming-aliases.conf
40-nonlatin.conf
41-ttf-arphic-ukai.conf
41-ttf-arphic-uming.conf
45-latin.conf
49-sansserif.conf
50-user.conf
51-local.conf
52-languageselector.conf
53-monospace-lcd-filter.conf
60-latin.conf
64-ttf-arphic-uming.conf
65-fonts-persian.conf
65-nonlatin.conf
65-ttf-thai-tlwg.conf
69-unifont.conf
70-yes-bitmaps.conf
75-ttf-arphic-ukai-select.conf
80-delicious.conf
90-synthetic.conf
90-ttf-arphic-ukai-embolden.conf
90-ttf-arphic-uming-embolden.conf
90-ttf-thai-tlwg-synthetic.conf

Tobias Wolf (towolf) wrote :

It’s not the ordering. It’s the config in 53-monospace-lcd-filter.conf

The reason this file is there is that when lcddefault was introduced some of the developers weren’t happy with the look of monospace fonts in their terminal at low point sizes. So a compromise was made to move to the new way but to special case terminals, which was where the vetoers spent most of their time.

Tobias Wolf (towolf) wrote :

BTW, this file still uses obsolete syntax:

    <edit name="lcd_filter" mode="assign">
      <const>lcdlegacy</const>
    </edit>

Tobias Wolf (towolf) wrote :

Looks like someone pulled the rug from under our feet:
http://thread.gmane.org/gmane.comp.lib.cairo/14916

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers