Closed Bug 404971 Opened 17 years ago Closed 10 years ago

Disable ligatures for sans-serif fonts to fix readability regressions

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: netrolller.3d, Unassigned)

References

()

Details

(Keywords: regression)

Sans-serif fonts usually don't suffer from character collision problems, so they don't really need ligatures. However, many sans-serif fonts still contain ligatures, which are often less-readable than the separate letters they replace. (See URL, the "fi" ligature looks like either a letter "h" or a Dirac's constant/h-bar sign.) As a result, the addition of ligature support essentially regressed the readability of sans-serif fonts. It might be good to turn off ligatures for such fonts.

Also, we should consider disabling the use of the "fl" ligature (often looks like a capital A in both roman and sans-serif), or at least implementing a black/whitelist for fonts with bad/good "fl" ligatures.
Flags: blocking1.9?
Roc or Pav any thoughts here?
schrep: not really beyond "we're doing what the font tells us to do."  It might be nice to allow people to explicitly disable ligatures (vs disabling everything) for some cases.  dunno...

I don't see this as a regression... perhaps a new unexpected feature.
I'd have to do a survey of the ligatures for sans serif fonts, but I actually suspect that the reporter is right in cases where the sans serif font is fixed width. Not so sure about sans serif in general.

Pav knows more, so I'd defer to him ...
"Fixed width" fonts that have ligatures are just broken.  See bug 384395 for an example, btw.
In case the site changes, see http://www.squarefree.com/2007/11/21/genevas-fi-ligature/ for screenshots.

I don't really like the idea of disabling ligatures just because some fonts screw them up.  I guess I could go for blacklisting known-broken fonts from getting their ligatures used, though.
We shouldn't really be in the business of blacklisting fonts imho.
How many fonts would be affected ? I went through the whole set of fonts installed by default on OS X 10.4, the only one affected is Geneva. Some non-roman fonts have difficult to read ligatures, but I'm using them completely out of context.

All commonly used fonts on webpages (the MS ones, including the new Vista ones, Times, Helvetica and the like) give pretty good results.
To me, this would be like disabling CSS because it can result in pages being more difficult to read. Or disabling images because some of them are unpleasant to view. Or disabling JavaScript because some scripts contain errors.

Ligatures, like CSS, images, video, JavaScript, native widgets, and many other features, can lead to worse results than before. But that alone is not a logical reason to disable any of them.

If anything, provide an option for disabling ligatures, but keep it enabled by default. This is done for JavaScript and images. If you feel web designers should have some control, spec out a CSS property and implement it. But don't just disable ligatures by default.
From http://www.will-harris.com/ligatures.htm ("Ligature Schmigature"):
"Most sans serif faces don't require ligatures either, and they've been included mostly for compatibility." (The site has more examples which show that ligatures shouldn't be in sans-serif fonts. Gill Sans, for example, has really strange ligatures, though not as bad as Geneva.) I think we should only disable ligatures for Latin alphabetic letters, not Arabic or anything like that.
Also, ligatures should be disabled when letter spacing is non-zero, like when it's explicitly specified or when justifying letters. Here is a little demo.
Text with letter-spacing=1:
O f f i c i a l   f i l l   f l a s h   S a u e r s t o f f f l a s c h e
Because ligatures can't be letter-spaced, here is what we get if we render the same line with ligatures:
O f fi c i a l   fi l l   fl a s h   S a u e r s t o ff fl a s c h e
And if the font has some more special ligatures (like "ffi" and "fffl"), we get:
O ffi c i a l   fi l l   fl a s h   S a u e r s t o fffl a s c h e
Of course, it's possible to place ligatures so the text doesn't get condensed, but IMO that looks even more weird:
O f fi  c i a l    fi l l   fl  a s h   S a u e r s t o ff  fl  a s c h e
O  ffi  c i a l    fi l l   fl  a s h   S a u e r s t o  fffl   a s c h e
So, letter-spacing should definitely turn off ligatures. (But be careful, "letter-spacing: 0;" must not disable ligatures just because it's specified explicitly!)
Nonzero letter-spacing already disables ligatures.  In fact, that was one of the workarounds I suggested to the owner of http://cfis.savagexi.com/.
(In reply to comment #10)
> Nonzero letter-spacing already disables ligatures.  In fact, that was one of
> the workarounds I suggested to the owner of http://cfis.savagexi.com/.
>
Exactly, and if ligatures are still enabled in the case of non-zero letter-spacing, that is a bug in the font (cough cough 'Lucida Grande' on OS X).

The problem is that all sans-serif ligatures are buggy. They decrease readability, look strange, make the text look *less* calligraphic, and are highly discouraged! We should definitely disable ligatures in all sans-serif fonts. (There are NO sans-serif fonts with good ligatures!)
That's obviously not universally true.  http://www.will-harris.com/ligatures.htm even has an example: 

'All Gill Sans Italic's "fl" ligature does is to increase the space between the "f" and the "l" so they don't meet at the top-thereby making them look more like two distinctly separate characters!'

That could also be accomplished using a kerning table, but that's what the font does.
Flags: blocking1.9? → blocking1.9-
Stefanik Gábor, do you know that to be true for writing systems other than the Latin alphabet? There's more in this world than A through Z, and that needs to be taken into consideration.

Seeing as ligatures can already be disabled with non-zero letter-spacing, I don't feel Mozilla should try to work around others' bugs (assuming you can count artistic freedom as a bug). Individual web developers can easily disable this if they feel it really reduces legibility.
I said, only for the Latin alphabet, and only on sans-serif fonts. I never said we should mess up Devanagari and Arabic.
Thank you James Justin Harrell. ou've goþ vision!

In fact there are a multitude of ligatured font coming in the near future with Indic languages supported by smartfonts. Indic smartfonts rely on ligature feature of OpenType to render orthographies. So, please, please leave ligatures alone for Latin-1 (SBCS).

Thank you your great honorable magicians. I salute you Gábor for your valor. There's lot more to be done here than to fix font makers faults.
(In reply to Gábor Stefanik from comment #15)
> I said, only for the Latin alphabet, and only on sans-serif fonts.

As a Web author, I intentionally choose Latin fonts with ligatures. I don't want a blanket ban on ligature for all Latin sans-serif fonts to break my pages. I think this should be WONTFIXed or we should have a blacklist of particularly badly-behaved OS X system fonts.
Can you utilize some of the opentype classifications for ligatures? It seems firefox is using all ligatures, ie Common, Contextual, Required, Rare and Historical. Why not trim the list down to just the Common/Required/Contextual ligatures?
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
(In reply to Douglas Calvert from comment #18)
> Why not trim the list down to just the Common/Required/Contextual ligatures?

That is already the case.
You need to log in before you can comment on or make changes to this bug.