Closed simoncozens closed 2 years ago
Jamo should be manually mapped to 'Hang' but it isn't
should we update fontTools/unicodedata/OTTags.py's SCRIPT_EXCEPTIONS list to add this manual mapping?
Yes.
Re: "jamo", I read in the OT spec that it's sort of deprecated, https://docs.microsoft.com/en-gb/typography/opentype/spec/scripttags
Hangul Jamo | 'jamo' | Use of this tag is not recommended. Fonts supporting Unicode conjoining jamo characters should use 'hang' instead. |
---|
IIUC, we want ot_tag_to_script("jamo") == "Hang"
, correct?
But we don't also want ot_tags_from_script("Hang") == ["jamo", "hang"]
(like it does for ["dev2", "deva"]
, etc.) ... but just ["hang"]
, ignoring the (supposedly deprecated?) "jamo" OT script tag.
Yeah, I think that's right.
The following OpenType script tags:
return
None
when passed tounicodedata.ot_tag_to_script
. (byzm
/math
/musc
are considered Common script, so there's no sensible Unicode script tag to map them to, andJamo
should be manually mapped to 'Hang' but it isn't.)This means that if any of them appear in a languagesystem statement,
ast.getScriptLanguageSystems
returns a dictionary withNone
keys:https://github.com/googlefonts/ufo2ft/blob/0ee84954455cb3f451b32ab8df8509cefe025c72/Lib/ufo2ft/featureWriters/ast.py#L36-L38
and that means that
_groupScriptsByTagAndDirection
passesNone
tounicodedata.script_horizontal_direction
https://github.com/googlefonts/ufo2ft/blob/0ee84954455cb3f451b32ab8df8509cefe025c72/Lib/ufo2ft/featureWriters/kernFeatureWriter.py#L339-L340
and that causes a KeyError in the kern writer.
As a workaround, all of these are left-to-right when used as a primary script, so if we get a
None
, we might want to just force the direction to beLTR
.