Struct harfbuzz_rs::Tag[][src]

pub struct Tag(pub hb_tag_t);

A type to represent 4-byte SFNT tags.

Tables, features, etc. in OpenType and many other font formats use SFNT tags as identifiers. These are 4-bytes long and usually each byte represents an ASCII value. Tag provides methods to create such identifiers from individual chars or a str slice and to get the string representation of a Tag.

Methods

impl Tag
[src]

Create a Tag from its four-char textual representation.

Examples

use harfbuzz_rs::Tag;
let cmap_tag = Tag::new('c', 'm', 'a', 'p');
assert_eq!(cmap_tag.to_string(), "cmap")

Trait Implementations

impl Copy for Tag
[src]

impl Clone for Tag
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Hash for Tag
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Tag
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Tag
[src]

impl Debug for Tag
[src]

Formats the value using the given formatter. Read more

impl Display for Tag
[src]

Formats the value using the given formatter. Read more

impl FromStr for Tag
[src]

The associated error which can be returned from parsing.

Parses a Tag from a &str that contains four or less ASCII characters. When the string's length is smaller than 4 it is extended with ' ' (Space) characters. The remaining bytes of strings longer than 4 bytes are ignored.

Examples

use harfbuzz_rs::Tag;
use std::str::FromStr;
let tag1 = Tag::from_str("ABCD").unwrap();
let tag2 = Tag::new('A', 'B', 'C', 'D');
assert_eq!(tag1, tag2);

Auto Trait Implementations

impl Send for Tag

impl Sync for Tag