def script_key_to_scripts(script_key): """Return a set of scripts for a script key. The script key is used by a font to define the set of scripts it supports. Some keys are ours, e.g. 'LGC', and some are standard script codes that map to multiple scripts, like 'Jpan'. In either case we need to be able to map a script code (either unicode character script code, or more general iso script code) to a font, and we do so by finding it in the list returned here.""" if script_key == 'LGC': return frozenset(['Latn', 'Grek', 'Cyrl']) elif script_key == 'Aran': return frozenset(['Arab']) elif script_key == 'HST': raise ValueError('!do not know scripts for HST script key') else: return lang_data.script_includes(script_key)
def script_key_to_scripts(script_key): """Return a set of scripts for a script key. The script key is used by a font to define the set of scripts it supports. Some keys are ours, e.g. 'LGC', and some are standard script codes that map to multiple scripts, like 'Jpan'. In either case we need to be able to map a script code (either unicode character script code, or more general iso script code) to a font, and we do so by finding it in the list returned here.""" if script_key == 'LGC': return frozenset(['Latn', 'Grek', 'Cyrl']) elif script_key == 'Aran': return frozenset(['Arab']) elif script_key == 'HST': raise ValueError('!do not know scripts for HST script key') else: return lang_data.script_includes(script_key)
def script_key_to_scripts(script_key): """Return a set of scripts for a script key. The script key is used by a font to define the set of scripts it supports. Some keys are ours, e.g. 'LGC', and some are standard script codes that map to multiple scripts, like 'Jpan'. In either case we need to be able to map a script code (either unicode character script code, or more general iso script code) to a font, and we do so by finding it in the list returned here.""" if script_key == "LGC": return frozenset(["Latn", "Grek", "Cyrl"]) elif script_key == "Aran": return frozenset(["Arab"]) elif script_key == "HST": raise ValueError("!do not know scripts for HST script key") elif script_key == "MONO": # TODO: Mono doesn't actually support all of Latn, we need a better way # to deal with pseudo-script codes like this one. return frozenset(["Latn"]) elif script_key in ["MUSE", "SYM2"]: return frozenset(["Zsym"]) else: return lang_data.script_includes(script_key)
def script_key_to_scripts(script_key): """Return a set of scripts for a script key. The script key is used by a font to define the set of scripts it supports. Some keys are ours, e.g. 'LGC', and some are standard script codes that map to multiple scripts, like 'Jpan'. In either case we need to be able to map a script code (either unicode character script code, or more general iso script code) to a font, and we do so by finding it in the list returned here.""" if script_key == 'LGC': return frozenset(['Latn', 'Grek', 'Cyrl']) elif script_key == 'Aran': return frozenset(['Arab']) elif script_key == 'HST': raise ValueError('!do not know scripts for HST script key') elif script_key == 'MONO': # TODO: Mono doesn't actually support all of Latn, we need a better way # to deal with pseudo-script codes like this one. return frozenset(['Latn']) elif script_key in ['MUSE', 'SYM2']: return frozenset(['Zsym']) else: return lang_data.script_includes(script_key)
def script_key_to_scripts(script_key): """Return a set of scripts for a script key. The script key is used by a font to define the set of scripts it supports. Some keys are ours, e.g. 'LGC', and some are standard script codes that map to multiple scripts, like 'Jpan'. In either case we need to be able to map a script code (either unicode character script code, or more general iso script code) to a font, and we do so by finding it in the list returned here.""" if script_key == 'LGC': return frozenset(['Latn', 'Grek', 'Cyrl']) elif script_key == 'Aran': return frozenset(['Arab']) elif script_key == 'HST': raise ValueError('!do not know scripts for HST script key') elif script_key == 'MONO': # TODO: Mono doesn't actually support all of Latn, we need a better way # to deal with pseudo-script codes like this one. return frozenset(['Latn']) elif script_key in ['MUSE', 'SYM2']: return frozenset(['Zsym']) else: return lang_data.script_includes(script_key)