Expand description
§use-script
Small writing script subtag primitives for RustUse.
§Example
use use_script::{is_script_code, parse_script_code};
let script = parse_script_code("latn").unwrap();
assert_eq!(script.as_str(), "Latn");
assert!(is_script_code("Cyrl"));§Scope
- Validate 4-letter script subtags.
- Normalize script subtags to title case.
- Provide a small
ScriptCodenewtype for validated script subtags.
§Non-goals
- Unicode text shaping.
- Font selection.
- Transliteration.
- Script detection.
§License
Licensed under either of the following, at your option:
- Apache License, Version 2.0
- MIT license
Structs§
- Script
Code - A normalized 4-letter writing script subtag.
Functions§
- is_
script_ code - Returns
truewhen the input is a 4-letter script subtag. - normalize_
script_ code - Normalizes a 4-letter script subtag to title case.
- parse_
script_ code - Parses a script subtag and normalizes it to title case.