6 Commits

Author SHA1 Message Date
Cosimo Lupo
c9259c4723
unicodedata: add ot_tags_from_script function
Fixes https://github.com/fonttools/fonttools/issues/1112

This implements the same logic found in harbfuzz hb-ot-tag.cc to
convert between Unicode (or ISO 15924) script codes to OpenType script
tags as defined at:
https://www.microsoft.com/typography/otspec/scripttags.htm

461a605fde/src/hb-ot-tag.cc (L127)
2018-01-18 20:20:17 +00:00
Cosimo Lupo
99ea0a3986 [unicodedata] add script_code func and 'default' fallback arg
`script_code` does the reverse of `script_name`: it takes a long
script name and returns a 4-letter script code.

Both `script_name` and `script_code` raise KeyError by default,
but can optionally return a default value instead.
2017-11-22 17:46:44 +01:00
Cosimo Lupo
afd2490a6c [unicodedata] add script_name function
Converts four-letter script codes to human-readable long names
2017-11-22 17:41:23 +01:00
Cosimo Lupo
012688ac20 [Tests] adjust unicodedata_test to expect short script codes 2017-11-22 17:41:23 +01:00
Cosimo Lupo
99719a8ccc [Tests] add tests for block and script_extension funcs 2017-11-20 18:17:10 +01:00
Cosimo Lupo
6d8813c00a [Tests] move unicodedata/scripts_test to unicodedata_test 2017-11-20 18:09:56 +01:00