Scripts v0.1.0
Script
pub struct Script {
// private fields
}
A script. Copy.
Scripts are named by their long names in the database, such as Latin or Old_Italic, and found by name loosely:
case, spaces, hyphens and underscores are ignored, so old italic names Old_Italic.
Associated functions
FromName
pub func FromName(name: char8[..]) -> Script?
The script whose long name is name, matched loosely.
| Name | Type | Description |
|---|---|---|
name | char8[..] | the name, such as Greek or old_italic |
Returns: the script, or none when no script has that name
Unknown
pub func Unknown() -> Script
The script of points the database assigns to none.
Returns: the Unknown script
Methods
Equals
pub func Equals(self: &Script, other: Script) -> bool
Whether other is the same script.
| Name | Type | Description |
|---|---|---|
other | Script | the other script |
Returns: whether they are one script
Number
pub func Number(self: &Script) -> uint32
The script's number: a stable small integer, less than ScriptCount(), in the order of the scripts' names.
Returns: the number
WriteName
pub func WriteName(
self: &Script,
into: var char8[..]
) -> uint
Writes the script's long name, such as Old_Italic, into into.
| Name | Type | Description |
|---|---|---|
into | var char8[..] | room for the name; the longest is under 32 bytes |
Returns: how many bytes were written, which is fewer than the name's length when into is too short
ScriptOf
pub func ScriptOf(scalar: char32) -> Script
The script scalar belongs to.
Parameters
| Name | Type | Description |
|---|---|---|
scalar | char32 | the scalar value to classify |
Returns: its script, Unknown for a point the database assigns to none
ScriptCount
pub func ScriptCount() -> uint
How many scripts there are, Unknown among them.
Returns: the count