1# Data updated to OpenType 1.8.2 as of January 2018. 2 3# Complete list of OpenType script tags at: 4# https://www.microsoft.com/typography/otspec/scripttags.htm 5 6# Most of the script tags are the same as the ISO 15924 tag but lowercased, 7# so we only have to handle the exceptional cases: 8# - KATAKANA and HIRAGANA both map to 'kana'; 9# - spaces at the end are preserved, unlike ISO 15924; 10# - we map special script codes for Inherited, Common and Unknown to DFLT. 11 12DEFAULT_SCRIPT = "DFLT" 13 14SCRIPT_ALIASES = { 15 "jamo": "hang", 16} 17 18SCRIPT_EXCEPTIONS = { 19 "Hira": "kana", 20 "Hrkt": "kana", 21 "Laoo": "lao ", 22 "Yiii": "yi ", 23 "Nkoo": "nko ", 24 "Vaii": "vai ", 25 "Zinh": DEFAULT_SCRIPT, 26 "Zyyy": DEFAULT_SCRIPT, 27 "Zzzz": DEFAULT_SCRIPT, 28} 29 30NEW_SCRIPT_TAGS = { 31 "Beng": ("bng2",), 32 "Deva": ("dev2",), 33 "Gujr": ("gjr2",), 34 "Guru": ("gur2",), 35 "Knda": ("knd2",), 36 "Mlym": ("mlm2",), 37 "Orya": ("ory2",), 38 "Taml": ("tml2",), 39 "Telu": ("tel2",), 40 "Mymr": ("mym2",), 41} 42 43NEW_SCRIPT_TAGS_REVERSED = { 44 value: key for key, values in NEW_SCRIPT_TAGS.items() for value in values 45} 46