Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webrender should be able to display a ligature with two different colors. #622

Closed
emilio opened this issue Dec 8, 2016 · 4 comments
Closed

Comments

@emilio
Copy link
Member

@emilio emilio commented Dec 8, 2016

Asked @glennw about this today, and decided that it was worth to open an issue.

I don't know who the relevant Gecko person is to know about this, maybe @jrmuizel?

This is one of the most annoying WebKit/Blink bugs I've ever found, there are multiple test cases in:

Reference test case: http://jsfiddle.net/xs5knzzd/5/

@jrmuizel
Copy link
Contributor

@jrmuizel jrmuizel commented Dec 8, 2016

I'm not sure how this works in Gecko. @jfkthame probably knows or could more easily say where to look.

@jfkthame
Copy link
Contributor

@jfkthame jfkthame commented Dec 8, 2016

Gecko collects text from a list of frames into a single textrun for shaping, so effects like ligatures can still occur across frame boundaries; see the BuildTextRunsScanner class in layout/generic/nsTextFrame.cpp. We'll only start a new textrun (and therefore interrupt shaping) if styles that would impact shaping don't match, such as the various font-* properties, text-transform, etc.; see BuildTextRunsScanner::ContinueTextRunAcrossFrames. In particular, a change in color does not make ContinueTextRunAcrossFrames return false, and so adjacent spans that differ only in color will be backed by a single continuous textrun, and shaped as a single unit.

@jfkthame
Copy link
Contributor

@jfkthame jfkthame commented Dec 8, 2016

When it comes to rendering the ligature at such a boundary (a separate issue from whether the ligature is formed at all, which is the problem those webkit/blink bugs are about), we have code in gfx/thebes/gfxTextRun.cpp to render partial ligatures when the range to be drawn (i.e. the section of the textrun corresponding to a particular element with a certain color) includes part of a ligated cluster of characters at the beginning or end. See gfxTextRun::Draw and its helper gfxTextRun::DrawPartialLigature.

@glennw
Copy link
Member

@glennw glennw commented Oct 3, 2017

The plan is for the client code to do this with clip rects. Please re-open if anything is needed from WR to handle this.

@glennw glennw closed this Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.