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

Split vvar and hvar #151

Merged
merged 8 commits into from
Jun 16, 2024
Merged

Split vvar and hvar #151

merged 8 commits into from
Jun 16, 2024

Conversation

LaurenzV
Copy link
Contributor

Not sure why they were together before, as they have pretty different entries (maybe they added new ones?). But anyway, I had to split them up so that I can add support for variations in y_origin, and while I was at I also added the other fields that seem to be in the spec.

See also
https://learn.microsoft.com/en-us/typography/opentype/spec/vvar
https://learn.microsoft.com/en-us/typography/opentype/spec/hvar

@RazrFalcon
Copy link
Collaborator

I do not remember why they weren't separate. Probably because hmtx/vmtx aren't.
Afaiu, the only difference is presence of y_origin in VVAR.

Also, I would prefer to keep public API the same.

@LaurenzV
Copy link
Contributor Author

If we keep them the same, how should we distinguish them from right side bearing / bottom side bearing then? Right now I haven't added a public API for them because we don't need them, but we might in the future, no?

@RazrFalcon
Copy link
Collaborator

No, I don't mind the HVAR/VVAR split. I just want to keep the old naming for glyph_hor_side_bearing and friends.

@LaurenzV
Copy link
Contributor Author

So what I mean is: The hvar table can have two pieces of information: the left side bearing offset and the right side bearing offset. See also the table here:
image

So if we just keep the API as "glyph_hor_side_bearing", then it is not clear whether it refers to the left side bearing or the right side bearing, it could be either since both, left and right are "horizontal"... The same for applies to `glyph_ver_side_bearing", which could be either the top side bearing or the bottom side bearing.

I mean if you want I will still change it back, but I just wanted to let you know.

@RazrFalcon
Copy link
Collaborator

Honestly, I'm not sure how "right side bearing" offset should work to begin with. We do not have right/bottom side bearing to begin with.
Left/top works by adding a variation offset to the base value, but there is not base value for right/bottom.
Am I missing something?

In any case, I suggest keeping public API unchanged.

@LaurenzV
Copy link
Contributor Author

Honestly, I'm not sure how "right side bearing" offset should work to begin with. We do not have right/bottom side bearing to begin with.

Not sure, all I know is that it's in the spec. :p

In any case, I suggest keeping public API unchanged.

Got it, I'll change it back.

@LaurenzV
Copy link
Contributor Author

Okay, so I changed back the function names in Face. I'm not sure if you also wanted me to change them in vvar and hvar, if yes then I'm not sure how to deal with the naming conflict...

@RazrFalcon
Copy link
Collaborator

All good. Fix benches and we're done.

@RazrFalcon RazrFalcon merged commit df952ff into harfbuzz:master Jun 16, 2024
2 checks passed
@LaurenzV LaurenzV deleted the hvar branch June 18, 2024 13:41
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

Successfully merging this pull request may close these issues.

2 participants