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

Add OTS_TAG() #50

Closed
behdad opened this issue Mar 3, 2015 · 3 comments
Closed

Add OTS_TAG() #50

behdad opened this issue Mar 3, 2015 · 3 comments

Comments

@behdad
Copy link
Contributor

behdad commented Mar 3, 2015

Currently OTS doesn't provide any macro to create an integer table tag to pass to getTableAction(). Would be nice to copy HB_TAG() so it's readily available. See eg:

https://codereview.chromium.org/954953002

@khaledhosny
Copy link
Owner

It should be trivial, but we had a similar macro that was removed in e14e0fa and I wonder what big/little endian issues OTS has that HarfBuzz doesn’t?

@behdad
Copy link
Contributor Author

behdad commented Mar 9, 2015

Ok so first we have to figure out whether the tag OTS expects is endian-dependent or not. We might need to fix that first.

@behdad
Copy link
Contributor Author

behdad commented Mar 9, 2015

Ok, I studied that all. It's safe to add the tag macro again. Internally OTS keeps tags in endian-specific order, but this function always accepts them big-endian, as can be seen in ots.cc, there's a htonl() before calling the virtual function:

ots::TableAction GetTableAction(ots::OpenTypeFile *header, uint32_t tag) { 
  ots::TableAction action = ots::TABLE_ACTION_DEFAULT; 

  action = header->context->GetTableAction(htonl(tag)); 

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