Crate swash[][src]

Font introspection, complex text shaping and glyph rendering.

For a comprehensive list of features provided by this crate, please check out the readme on GitHub.

Note

This is a low level library focusing on implementations of OpenType and various related Unicode specifications for building high quality, high performance text layout and rendering components with minimal overhead.

If you’re looking for something higher level, please stay tuned– work is in progress.

Usage

The primary currency in this crate is the FontRef struct so you’ll want to start there to learn how to construct and use fonts.

Documentation for shaping and scaling is provided in the respective modules.

Re-exports

pub use zeno;

Modules

iter

Collection of various iterators over metadata contained in a font.

proxy

Proxies used to efficiently rematerialize metadata.

scale

Scaling, hinting and rasterization of visual glyph representations.

shape

Mapping complex text to a sequence of positioned glyphs.

text

Character properties and textual analysis.

Structs

Attributes

Primary attributes for font classification: stretch, weight and style.

BitmapStrike

Collection of bitmaps of a specific size and format.

CacheKey

Uniquely generated value for identifying and caching fonts.

Charmap

Maps characters to nominal glyph identifiers.

ColorPalette

Collection of colors.

Feature

Typographic rule that produces modifications to a sequence of glyphs.

FontDataRef

Reference to the content of a font file.

FontRef

Reference to a font.

GlyphMetrics

Glyph advances, side bearings and vertical origins.

Instance

Named instance in a variable font.

LocalizedString

Represents a single localized string in a font.

Metrics

Global font metrics.

ObliqueAngle

Angle of an oblique style in degrees from -90 to 90.

Setting

Setting combining a tag and a value for features and variations.

Stretch

Visual width of a font– a relative change from the normal aspect ratio.

Synthesis

Synthesis suggestions for mistmatched font attributes.

Variation

Axis of variation in a variable font.

Weight

Visual weight class of a font on a scale from 1 to 1000.

WritingSystem

Script, language and associated typographic features available in a font.

Enums

Action

Modification performed by a feature.

StringId

Identifier for well-known localized strings in a font.

Style

Visual style or ‘slope’ of a font.

Usability

Theme of a palette with respect to background color.

Functions

tag_from_bytes

Creates a tag from four bytes.

tag_from_str_lossy

Creates a tag from the first four bytes of a string, inserting spaces for any missing bytes.

Type Definitions

GlyphId

Glyph identifier.

NormalizedCoord

Normalized variation coordinate in 2.14 fixed point format.

Tag

Four byte tag value.