does not use kerning tables at >20px (text-rendering: optimizeLegibility)

Bug #617522 reported by Tobias Wolf
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
launchpad-bug-form
Fix Released
Critical
Richard Henry Lee

Bug Description

We are not testing Kerning Tables at all now in the browser-based fonttest tool. By default internal kerning table are disabled for performance reasons in browser layout engines *unless the CSS enables this*.

Please see CSS property «text-rendering».

from: https://developer.mozilla.org/en/CSS/text-rendering
optimizeSpeed
    Gecko will emphasize rendering speed over
    legibility and geometric precision while drawing
    text. Disables kerning and ligatures.
optimizeLegibility
    Gecko will emphasize legibility over rendering
    speed and geometric precision. This enables
    kerning and optional ligatures.
geometricPrecision
    Gecko will emphasize geometric precision over
    rendering speed and legibility, currently the same
    as optimizeLegibility.

Please see the effect of text-rendering CSS property in the attached screenshot.

Adding the property to fonttest should help, but to what degree this will yield the same kerning as the desktopi is a question of further testing. Chrome for instance has problems when text-rendering: optimizeLegibility is on.

Revision history for this message
Tobias Wolf (towolf) wrote :
Revision history for this message
Tobias Wolf (towolf) wrote :
Tobias Wolf (towolf)
Changed in ubuntu-font-family:
status: New → Confirmed
Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 617522] Re: fonttest tool is flawed because of default CSS

Thanks for spotting this, it's obviously a hugely important issue!

Can the optimization be changed in real time, "live in the browser"
using JavaScript? Could we have a button which lets users toggle it on
and off, to see if that's the issue?

Which browsers support this? Is it configurable? And how are they
configured by default in Ubuntu?

Mark

Revision history for this message
Tobias Wolf (towolf) wrote : Re: fonttest tool is flawed because of default CSS

I did some quick tests (Firefox, Chromium, Opera). It’s a mess.

First of all toggling that property dynamically doesn’t work in Firefox, because it doesn’t expose it in the DOM API.
Your best bet is to statically set the style and open two tabs and switch between those.

In essence they all have different kerning. Sometimes depending on text size. There are effects where browsers enable kerning only when the text size goes above a threshold.

I think the most correct looking kerning when comparing to the desktop (useful test tool "pango-view") is Firefox/Gecko with text-rendering: optimizeLegibility on.

Revision history for this message
Tobias Wolf (towolf) wrote :
Revision history for this message
Tobias Wolf (towolf) wrote :
Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 617522] Re: fonttest tool is flawed because of default CSS

Which package contains pango-view?

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

So, I think we should go for optimiseLegibility. I also think we should
ask the platform team to ensure that the setting is consistently used as
the default on Firefox, and in other browsers to the extent they support
it. In other words, Ubuntu should be as fast as possible while still
being correctly rendered for style.

Mark

Revision history for this message
Tobias Wolf (towolf) wrote : Re: fonttest tool is flawed because of default CSS

pango-view is in libpango1.0-dev

example:
pango-view --font "Ubuntu Beta 48" --waterfall --markup -t "VARIANCE VA Te Ta"

Chromium is affected by this bug: http://crbug.com/41990

Revision history for this message
Tobias Wolf (towolf) wrote :

Bug #614478
Bug #609260
Bug #608823

are all artifacts of the problem described herin I think.

Revision history for this message
Tobias Wolf (towolf) wrote :
Paul Sladen (sladen)
summary: - fonttest tool is flawed because of default CSS
+ fonttest screenshot does not use kerning tables (text-rendering:
+ optimizeLegibility)
Changed in ubuntu-font-family:
importance: Undecided → Critical
assignee: nobody → Richard Lee (Canonical) (rhlee)
affects: ubuntu-font-family → lp-bug-form
summary: - fonttest screenshot does not use kerning tables (text-rendering:
+ does not use kerning tables at >20px (text-rendering:
optimizeLegibility)
Revision history for this message
Tobias Wolf (towolf) wrote :

Apparently Opera always kerns and Chromium never kerns.

Revision history for this message
Paul Sladen (sladen) wrote :

Tobias: that's an excellent .gif. If you force the CSS 'text-rendering: ...' can you manage to get more consistent rendering across the browsers?

Revision history for this message
Tobias Wolf (towolf) wrote :

This is all really inconsistent. Apparently rendering canvas is a totally different pair of shoes. It’s not affected by text-rendering property in Firefox.

But the textarea box is affected.

Just using Firebug is not enough, I had to write user stylesheet in ~/.mozilla/firefox/<bla>/chrome/userContent.css

Really, what she should be testing is the font as a system font. So have to test how it’s rendered in GTK using Pango and Cairo and how it’s rednered in KDE with whatever they are using.

Revision history for this message
Richard Henry Lee (rhlee) wrote :

Just came across this bug.

Is there anything on my end you need me to implement?

Revision history for this message
Richard Henry Lee (rhlee) wrote :

I have set the text-rendering to optimizeLegibility in the CSS.

Released in 153

Changed in lp-bug-form:
status: Confirmed → Fix Released
Revision history for this message
Paul Sladen (sladen) wrote :

This needs re-checking to see if fixed the 'auto-screenshot' canvas rendering as well as the text entry boxes.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.