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

STAT table support #1127

Merged
merged 30 commits into from
May 9, 2020
Merged

STAT table support #1127

merged 30 commits into from
May 9, 2020

Conversation

khaledhosny
Copy link
Collaborator

@khaledhosny khaledhosny commented Apr 29, 2020

Fixes #176.

Almost done, except for name id sharing (still trying to figure out how to reliably do that). Opening to see if CI is happy with what I’ve got so far.

@lgtm-com

This comment has been minimized.

@lgtm-com

This comment has been minimized.

@lgtm-com

This comment has been minimized.

@lgtm-com

This comment has been minimized.

@khaledhosny
Copy link
Collaborator Author

The LGTM alerts are in ANTLR generated code, is there away to silence these?

@josh-hadley
Copy link
Collaborator

The LGTM alerts are in ANTLR generated code, is there away to silence these?

There is a way to do it: https://lgtm.com/help/lgtm/customizing-file-classification

But, worth noting: the LGTM checks are informative only. They won't block the PR. So feel free to just ignore.

@cjchapman
Copy link
Contributor

@khaledhosny I just made this change on develop which should help for future PRs:

afdko/.lgtm.yml

Lines 13 to 16 in 584fab7

path_classifiers:
generated:
# Classify featgram.c as generated code so that it won't get alerts:
- root/c/makeotf/makeotf_lib/source/hotconv/featgram.c

@khaledhosny
Copy link
Collaborator Author

khaledhosny commented May 1, 2020

But, worth noting: the LGTM checks are informative only. They won't block the PR. So feel free to just ignore.

It was a bit annoying since it kept adding new comments each time I push new changes.

@khaledhosny I just made this change on develop which should help for future PRs:

Thanks. I rebased my branch and it helps indeed.

@khaledhosny
Copy link
Collaborator Author

I’m trying to implement name ID sharing, but all ideas I can come up with seem unnecessarily complicated:

  • It has to be deferred to table compilation time otherwise defining STAT before name will give different results.
  • This means lots of changes to how the name table is built since the name ID will be known only when the table is about to be compiled not when the name is added, unlike the case now.
  • The criteria of when to share and when not gives me headache, with all the possible combinations of platform, language, and encoding IDs.

Also the value of such sharing might not be that big:

  • There is not much file saving, the actual strings are always shared even if used for different name IDs, so we are only saving the 12 bytes of the name record.
  • There is already ElidedFallbackNameID, and other user name (e.g. for feature parameters don’t do such sharing).

Sorry for always coming back to this question 😄 but do we really want to to do this 😄 Last time to ask I promise.

@josh-hadley
Copy link
Collaborator

I’m trying to implement name ID sharing, but all ideas I can come up with seem unnecessarily complicated:
[...]
Sorry for always coming back to this question 😄 but do we really want to to do this 😄 Last time to ask I promise.

OK, let's proceed without nameRecord sharing for now and at least get the basic implementation integrated. We can defer the sharing feature until later or possibly devise a post-process action to handle it.

Thanks for your effort on this, @khaledhosny !

@khaledhosny khaledhosny marked this pull request as ready for review May 4, 2020 16:56
@khaledhosny
Copy link
Collaborator Author

All, good then. This should be more or less done, though I’d like to see #1128 before merging to check if the test coverage for the new code is good or not. The code is otherwise ready for review, and the documentation should follow once we are happy with the code.

@josh-hadley
Copy link
Collaborator

I’d like to see #1128 before merging to check if the test coverage for the new code is good or not.

I will try to work that out soon (via GHA, using a similar technique as I did in psautohint).

@cjchapman
Copy link
Contributor

cjchapman commented May 4, 2020

@khaledhosny Sorry, it looks like I made a mistake in the path to featgram.c in the .lgtm.yml where I indicated that it is a generated file. I think I've fixed it on develop in this commit.

Move ElidedFallbackName errors to featgram.g so that line number i
sprinted as well, and improve the wording of other errors.
Make sure the name ID used actually exists in the name table.
They were separate in anticipation of name id sharing, but this is not
going to happen at the moment.
@khaledhosny
Copy link
Collaborator Author

I think the code is ready for review and the test coverage is good.

@punchcutter
Copy link
Contributor

punchcutter commented May 8, 2020

@khaledhosny Did you update the spec as well? I don't see that update in here, but the tests reference the new sections of the spec.

@khaledhosny
Copy link
Collaborator Author

I was waiting until the code is finalized, but I guess it is time to do it.

@punchcutter
Copy link
Contributor

Ok, no problem either way. Just wanted to double check.

Describing the syntax, not attempt at describing what the table does.
Copy link
Contributor

@punchcutter punchcutter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Khaled! LGTM

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.

Implement support for syntax for STAT table
4 participants