parlance 0.1.0

Fundamental text property types
Documentation
  • Coverage
  • 100%
    80 out of 80 items documented1 out of 1 items with examples
  • Size
  • Source code size: 101.24 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.08 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • linebender/parley
    574 76 66
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • xStrom

Parlance

Fundamental text property types

Latest published version. Documentation build status. Dependency staleness status. Linebender Zulip chat. Apache 2.0 or MIT license.

Fundamental text property types.

This crate is intended as a lightweight, no_std-friendly vocabulary layer that can be shared across style systems, text layout engines, and font tooling. It focuses on small, typed representations of common “leaf” concepts (weights, widths, OpenType tags, language tags, etc).

Features

  • std (enabled by default): This is currently unused and is provided for forward compatibility.
  • bytemuck: Implement traits from bytemuck on [GenericFamily].

Example

use parlance::{Language, Tag};

let tag = Tag::parse("wght").unwrap();
assert_eq!(tag.to_bytes(), *b"wght");

let lang = Language::parse("zh-Hans-CN").unwrap();
assert_eq!(lang.as_str(), "zh-Hans-CN");
assert_eq!(lang.language(), "zh");
assert_eq!(lang.script(), Some("Hans"));
assert_eq!(lang.region(), Some("CN"));

Minimum supported Rust Version (MSRV)

This version of Parlance has been verified to compile with Rust 1.88 and later.

Future versions of Parlance might increase the Rust version requirement. It will not be treated as a breaking change and as such can even happen with small patch releases.

Community

Discussion of Parlance development happens in the Linebender Zulip, specifically the #parley channel. All public content can be read without logging in.

Contributions are welcome by pull request. The Rust code of conduct applies.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache 2.0 license, shall be licensed as noted in the License section, without any additional terms or conditions.

License

Licensed under either of

at your option.