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

hb_set_intersect appears to be broken in 1.6.2 #579

Closed
jfkthame opened this issue Oct 24, 2017 · 10 comments
Closed

hb_set_intersect appears to be broken in 1.6.2 #579

jfkthame opened this issue Oct 24, 2017 · 10 comments

Comments

@jfkthame
Copy link
Collaborator

I'm seeing unexpected results from hb_set_intersect (often, but not invariably, returning an empty result, when the two sets did have some intersection).

This is breaking behavior in Firefox, where it is wanting to determine whether a given feature supports all the glyphs in a text run.

E.g.

inputGlyphs: 886 887 888 889 890 891 892 893 894 895 1024 1152
glyphsInRun: 889 1024
intersection: (empty)

But:

inputGlyphs: 886 887 888 889 890 891 892 893 894 895 1024 1152
glyphsInRun: 887 888 889 1121
intersection: 887 888 889 1121

For a given pair of sets, the result is consistent, but it's not obvious why the one case fails while the other succeeds.

@jfkthame
Copy link
Collaborator Author

@jfkthame
Copy link
Collaborator Author

For a given pair of sets, the result is consistent, but it's not obvious why the one case fails while the other succeeds.

On second glance, neither result there looks correct, actually: in the second example, the "intersection" includes a GID that was not present in the inputGlyphs set. Oops!

@behdad
Copy link
Member

behdad commented Oct 25, 2017

That's why I hated implementing my own set... I'll take a look soon.

@behdad
Copy link
Member

behdad commented Oct 25, 2017

Separately, I'm interested to learn more about how you use this stuff in Firefox. I know about the word cache usage, but this sounds like something different.

@behdad
Copy link
Member

behdad commented Oct 25, 2017

Humm. I added a test for the samples you provide, but it's passing.

@behdad
Copy link
Member

behdad commented Oct 25, 2017

@jfkthame any chance you can debug this a bit?

@jfkthame
Copy link
Collaborator Author

See PR#582 for a test that fails (at least for me). Haven't tried to debug yet.

jfkthame added a commit that referenced this issue Oct 26, 2017
@jfkthame
Copy link
Collaborator Author

With the second commit in #582, the added test now passes for me.

@behdad behdad closed this as completed in dfd234a Oct 26, 2017
@jfkthame
Copy link
Collaborator Author

Separately, I'm interested to learn more about how you use this stuff in Firefox. I know about the word cache usage, but this sounds like something different.

We use this when determining whether a feature such as superscript covers all the glyphs that are present in an element styled with font-variant-position: super. If so, we can render the font-variant style using the OpenType feature, but if not, we'll use a synthetic fallback for the whole run (because a mix of "real" superscripts and fake ones within a single element could look pretty bad).

@behdad
Copy link
Member

behdad commented Oct 26, 2017

We use this when determining whether a feature such as superscript covers all the glyphs that are present in an element styled with font-variant-position: super. If so, we can render the font-variant style using the OpenType feature, but if not, we'll use a synthetic fallback for the whole run (because a mix of "real" superscripts and fake ones within a single element could look pretty bad).

Cool. Thanks. FYI @drott

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants