letter-spacing doesn't disable ligatures at larger point sizes

RESOLVED FIXED

Status

()

Core
Layout: Text
RESOLVED FIXED
9 years ago
2 years ago

People

(Reporter: zwol, Assigned: jfkthame)

Tracking

({polish})

Trunk
x86
Linux
polish
Points:
---
Dependency tree / graph
Bug Flags:
wanted1.9.1 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

9 years ago
Created attachment 347447 [details]
test case

The attached test case repeats the same word over and over again at different font sizes, but always with the same letter-spacing.  At some intermediate size, the "ffi" ligature starts being used, despite the nonzero letter-spacing.

If anything, I would argue that the bigger the text is, the *more* important it is for letter-spacing to disable ligatures, because the visual glitch is more obvious.
Flags: wanted1.9.1?
(Reporter)

Comment 1

9 years ago
(Try changing the page zoom!)

Comment 2

9 years ago
WFM on Mac.
(Reporter)

Comment 3

9 years ago
Created attachment 347690 [details]
screen shot illustrating problem

Well, here's a screen shot, so you can see I'm not making this up.

It might be font-specific or Linux (Pango?) -specific.
I see it as well on Linux.
Flags: wanted1.9.1? → wanted1.9.1+
(Reporter)

Comment 5

9 years ago
I've analysed this a bit; the problem is actually in per-platform gfx code.  Only the MacOS text renderer honors the TEXT_DISABLE_OPTIONAL_LIGATURES flag returned by nsLayoutUtils::GetTextRunFlagsForStyle.  We need to make all the other implementations of gfxFontGroup pay attention to it as well.

Per discussion on IRC, this is now a meta-bug which will shortly grow dependencies for each platform font backend; but it maybe makes sense to work out some reftests in this bug, since they would (hopefully) be platform-independent.
Assignee: nobody → jfkthame
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Whiteboard: qawanted:testcase
(Reporter)

Updated

9 years ago
Depends on: 465393
(Reporter)

Updated

9 years ago
Depends on: 465395
(Reporter)

Updated

9 years ago
Depends on: 465396
(Reporter)

Comment 6

9 years ago
The Mac code turns on ATSUI's "required" and "common" ligature categories by default, and if TEXT_DISABLE_OPTIONAL_LIGATURES is set, it turns "common" back off.  That seems like a good rule to copy for the Windows and Linux code, but it looks to me like the implementation won't be as simple as toggling a flag in the OS-provided rendering library, alas.

ATSUI ligature categories are defined here: http://developer.apple.com/documentation/Carbon/Conceptual/ATSUI_Concepts/atsui_app_features/chapter_9_section_15.html

Updated

9 years ago
Keywords: testcase-wanted
Whiteboard: qawanted:testcase
(Reporter)

Comment 7

9 years ago
Per discussion in the dependent bugs, a proper fix doesn't seem doable anytime soon.

1) It occurred to me that an obvious workaround for page authors affected by this bug would be to insert a Unicode WORD JOINER or ZERO-WIDTH NO-BREAK SPACE character between the letters that shouldn't be ligatured.  But this introduces *extra* spacing (because the letter-spacing gap is inserted on either side of the invisible character) so that's no good.  How hard would it be to make those two characters not introduce extra space?  Can anyone suggest a workaround of similar invasiveness that actually does work?

2) I looked at the HarfBuzz mailing list and Git repo -- it doesn't seem to be a live project.  Hoping for that as the solution to all our font-shaping problems going forward doesn't seem like a good plan to me, unless we're going to devote our own engineering effort to it...
(In reply to comment #7)
> Per discussion in the dependent bugs, a proper fix doesn't seem doable anytime
> soon.
> 
> 1) It occurred to me that an obvious workaround for page authors affected by
> this bug would be to insert a Unicode WORD JOINER or ZERO-WIDTH NO-BREAK SPACE
> character between the letters that shouldn't be ligatured.  But this introduces
> *extra* spacing (because the letter-spacing gap is inserted on either side of
> the invisible character) so that's no good.  How hard would it be to make those
> two characters not introduce extra space?

That would be easy.

> 2) I looked at the HarfBuzz mailing list and Git repo -- it doesn't seem to be
> a live project.  Hoping for that as the solution to all our font-shaping
> problems going forward doesn't seem like a good plan to me, unless we're going
> to devote our own engineering effort to it...

That is the plan.
(In reply to comment #7)
 
> 1) It occurred to me that an obvious workaround for page authors affected by
> this bug would be to insert a Unicode WORD JOINER or ZERO-WIDTH NO-BREAK SPACE
> character between the letters that shouldn't be ligatured. 

ZERO WIDTH NON-JOINER would be the character to use for this, but this workaround doesn't scale well: I don't think we can expect page authors to insert extra characters between every pair of letters that might get ligated in some font somewhere.

> But this introduces
> *extra* spacing (because the letter-spacing gap is inserted on either side of
> the invisible character) so that's no good.  How hard would it be to make those
> two characters not introduce extra space? 

That (generalized to cover all invisible characters) seems like a bug that we should fix anyway.
(In reply to comment #9)
> That (generalized to cover all invisible characters) seems like a bug that we
> should fix anyway.

Bug 253143?
(Assignee)

Comment 11

6 years ago
This should be fixed on trunk now - since Karl's patches in bug 569770 landed - for Latin and other  scripts that we shape with harfbuzz (which basically means most text except for Indic/SEAsian scripts).
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Depends on: 569770
Resolution: --- → FIXED
Keywords: testcase-wanted
You need to log in before you can comment on or make changes to this bug.