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

Combined 32bit FormatOffset with more offset bits #4

Closed
behdad opened this issue Jun 26, 2021 · 1 comment
Closed

Combined 32bit FormatOffset with more offset bits #4

behdad opened this issue Jun 26, 2021 · 1 comment

Comments

@behdad
Copy link
Member

behdad commented Jun 26, 2021

This is one of the tricks I thought of as ugly and hence wasn't planning of pursuing. But seeing #1 and other suggestions re varint encoding, I'm going to put it here for consideration.

Currently, all OpenType Lookup subtables (except for (Chain)?Context(Subst|Pos)Format3) start with:

  uint16 Format;
  Offset16 Coverage;

The Format is currently only used to encode 1, 2, or 3. We can reuse the top byte of format for additional offset bits. That is:

  uint8 OffsetTopByte
  uint8 Format;
  uint16 OffsetLow2Bytes

This has the nice property that if the offset fits in 16bits, then Format will be parsable by old implementations. If offset is large, then Format will look wrong by old implementations and ignored.

@rsheeter
Copy link
Contributor

Gross but I kind of like it.

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

No branches or pull requests

2 participants