-
Notifications
You must be signed in to change notification settings - Fork 43
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
Consider scripts with no directionality to be LTR #576
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
@@ -337,7 +337,10 @@ def _groupScriptsByTagAndDirection(feaScripts): | |||
# direction (DFLT is excluded) | |||
scriptGroups = {} | |||
for scriptCode, scriptLangSys in feaScripts.items(): | |||
direction = unicodedata.script_horizontal_direction(scriptCode) | |||
if scriptCode: | |||
direction = unicodedata.script_horizontal_direction(scriptCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or you could also do direction = unicodedata.script_horizontal_direction(scriptCode, default="LTR")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually that may hide other bugs, it's better like you did (we still get a KeyError if a not-None scriptCode is not found by script_horizontal_direction)
What does HarfBuzz do for these scripts? Math can be set RTL, not sure about the others. |
I don't know if related, but it looks like the fontTools.unicodedata' list of RTL scripts could be not up to date with latest Unicode 14, see the link in the comment at |
(ok, it's not related to this issue, but it's good that I checked: we were actually missing Old Uyghur from the RTL script list, it was added with Unicode 14.0 => fonttools/fonttools#2499) |
unicodedata.ot_tag_to_script
#575unicodedata.ot_tag_to_script
#575