Scripts v0.1.0

Source
The script each code point belongs to.

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.

Source

Associated functions

FromName

pub func FromName(name: char8[..]) -> Script?

The script whose long name is name, matched loosely.

NameTypeDescription
namechar8[..]the name, such as Greek or old_italic

Returns: the script, or none when no script has that name

Source

Unknown

pub func Unknown() -> Script

The script of points the database assigns to none.

Returns: the Unknown script

Source

Methods

Equals

pub func Equals(self: &Script, other: Script) -> bool

Whether other is the same script.

NameTypeDescription
otherScriptthe other script

Returns: whether they are one script

Source

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

Source

WriteName

pub func WriteName(
    self: &Script,
    into: var char8[..]
) -> uint

Writes the script's long name, such as Old_Italic, into into.

NameTypeDescription
intovar 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

Source

ScriptOf

pub func ScriptOf(scalar: char32) -> Script

The script scalar belongs to.

Source

Parameters

NameTypeDescription
scalarchar32the 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.

Source

Returns: the count