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
Parse "x-hbsc" language tags as script overrides #645
Conversation
To build the documentation you need to configure with |
Thanks. Looks good in general. Except that the name |
For documentation, you just need to add a comment block before the function definition, and add it to harfbuzz-sections.txt. |
For the function as I wrote it without further refactoring, how is the name Your suggested refactoring makes sense. Relatedly, I have been thinking about improving the BCP 47 parsers, currently scattered throughout various functions; that would fix #362. I intended this pull request to just be for the script overrides, and I am wary of making a big API change to a project where I am not a core contributor, but if you think this is a good idea I can work on it. |
Yeah I'd rather we add one new API that handles multiple enhancements than adding piecemeal improvements. |
Another approach, maybe better, would be to add |
The refactoring is coming along nicely. I’ve got some questions about HarfBuzz’s language code policy. What sort of BCP 47 normalization is the caller responsible for? HarfBuzz canonicalizes everything to lowercase (via If HarfBuzz isn’t responsible for normalizing deprecated or invalid codes, should it support them? The answer could be:
Some unrelated languages coincidentally have the same name. For example, |
Regarding language tag normalization (handling deprecated subtags such as |
As long as it's not too much code, we should whatever BCP-47 requires. |
Closing. Continued in #730 |
If a private use subtag begins with “hbsc” it overrides the script tag. This allows testing of 'deva' in a font which also supports 'dev2'. “hbot” and “hbsc” can be used with each other in either order. This also fixes the language tag parser so that it ignores “x-hbot” when the “x” is not its own subtag.
To implement that, this pull request adds the function
hb_ot_tags_from_language_and_script
to the API. I didn’t document it: the files in docs/ seem to be automatically generated, but I couldn’t find the generator. That part I leave to you. Or you can tell me how to do it.Closes #495.