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

Is skipping ValueFormat1 == 0 in class kerning correct? #1

Open
justvanrossum opened this issue Apr 19, 2017 · 12 comments
Open

Is skipping ValueFormat1 == 0 in class kerning correct? #1

justvanrossum opened this issue Apr 19, 2017 · 12 comments

Comments

@justvanrossum
Copy link

In line 250 of getKerningPairsFromOTF.py I see this:

                            elif valueFormat == 0:
                                # valueFormat zero is caused by a value of <0 0 0 0> on a class-class pair; skip these
                                continue

Is this really correct? If valueFormat == 0, no kerning data from the entire subtable is read at all, which makes me wonder what the use of such a subtable is. (I'm looking at a font with a PairPosFormat2 subtable with ValueFormat1 == 0, and I can't quite figure out why it's there and how it should behave.)

@frankrolf
Copy link
Member

I wonder if this represents a class-class pair with an explicit zero kerning value and one (or several) non-zero exceptions.

@behdad
Copy link

behdad commented Apr 20, 2017

It's possible that ValueFormat2 is nonzero, which means second glyph in pairs is adjusted but no first glyph.

@justvanrossum
Copy link
Author

That's not the case here, ValueFormat2 is also 0.

@behdad
Copy link

behdad commented Apr 20, 2017

Then yes, that's a degenerate subtable. Is Coverage empty as well?

@justvanrossum
Copy link
Author

No, Coverage is not empty, and both ClassDefs are filled, too. It was compiled by AFDKO.

If I do not ignore that subtable (but take those values as 0) I don't get the correct kerning out of the font, so that suggests that getKerningPairsFromOTF.py is doing the right thing. But then, why did AFDKO put it in there...

I may not pursue this further, though, as I have something that seems to works well now. This issue can be labeled "just curious" :)

@behdad
Copy link

behdad commented Apr 20, 2017

Then that subtable will act as a stopper. Anything on the coverage gets a zero there and next subtables will NOT be search for those glyphs as the first in a kern pair.

@justvanrossum
Copy link
Author

Ok, but then there is after all something wrong with either the font or getKerningPairsFromOTF.py or both.

@behdad
Copy link

behdad commented Apr 20, 2017

Not arguing with that :).

@frankrolf
Copy link
Member

Just, would it be possible to send over the font? I am curious now!

@justvanrossum
Copy link
Author

Emailed you.

@behdad
Copy link

behdad commented Apr 20, 2017

I also like to see the font. I read the code and found a few different issues. Filing new issue now.

@behdad
Copy link

behdad commented Apr 27, 2017

For reference: #2

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

3 participants