Crate zng_ext_font

Source
Expand description

Font loading, text segmenting and shaping.

§Crate

This crate is part of the zng project.

§Cargo Features

This crate provides 2 feature flags, 0 enabled by default.

§"hyphenation_embed_all"

Embed hyphenation dictionaries.

See the hyphenation for more details.

§"svg"

Enable support for SVG image glyphs.

This feature signals that the IMAGES service supports SVG. The app must ensure that this is so by using zng-ext-svg or another SVG extension.

Modules§

font_features
Font features and variation types.

Macros§

font_variations
Initialize a FontVariations map.

Structs§

BidiLevel
Embedding Level
CaretIndex
Defines an insert offset in a shaped text.
ColorGlyph
Represents all layer glyphs selected by the font to replace a colored glyph.
ColorGlyphs
COLR table.
ColorPalette
Represents a color palette entry.
ColorPaletteType
Represents a color palette v1 flag.
ColorPalettes
CPAL table.
CustomFont
Custom font builder.
FONTS
Font loading, custom fonts and app font configuration.
Font
A sized font face.
FontChangedArgs
FONT_CHANGED_EVENT arguments.
FontDataRef
Reference to in memory font data.
FontFace
A font face selected from a font family.
FontFaceList
A list of FontFace resolved from a FontName list, plus the fallback font.
FontFaceMetrics
Various metrics that apply to the entire FontFace.
FontList
A list of Font created from a FontFaceList.
FontManager
Application extension that manages text fonts.
FontMetrics
Various metrics about a Font.
FontName
Font family name.
FontNames
A list of font names in priority order.
FontStretch
The width of a font as an approximate fraction of the normal width.
FontWeight
The degree of stroke thickness of a font. This value ranges from 100.0 to 900.0, with 400.0 as normal.
GenericFonts
Generic fonts configuration for the app.
HYPHENATION
Hyphenation service.
HyphenationDataDir
Represents a hyphenation data source that searches a directory.
HyphenationDataEmbedded
Represents embedded hyphenation data.
LayoutDirections
Identifies what direction segments a ShapedLine has.
SegmentedText
A string segmented in sequences of words, spaces, tabs and separated line breaks.
SegmentedTextIter
Segmented text iterator.
ShapedLine
Represents a line selection of a ShapedText.
ShapedSegment
Represents a word or space selection of a ShapedText.
ShapedText
Output of text layout.
TextOverflowInfo
Info about a shaped text overflow in constraint.
TextSegment
Represents a single text segment in a SegmentedText.
TextShapingArgs
Extra configuration for shape_text.

Enums§

FontChange
Possible changes in a FontChangedArgs.
FontColorPalette
Color palette selector for colored fonts.
FontLoadingError
Reasons why a loader might fail to load a font.
FontStyle
The italic or oblique form of a font.
GlyphLoadingError
Reasons why a font might fail to load a glyph.
Hyphens
Hyphenation mode.
Justify
Text alignment justification mode.
LineBreak
Configuration of text wrapping for Chinese, Japanese, or Korean text.
ShapedColoredGlyphs
Represents normal and colored glyphs in ShapedText::colored_glyphs.
ShapedImageGlyphs
Represents normal and image glyphs in ShapedText::image_glyphs.
TextSegmentKind
The type of an inline/text segment.
TextTransformFn
Text transform function.
WhiteSpace
Text white space transform.
WordBreak
Configure line breaks inside words during text wrap.

Statics§

FONT_CHANGED_EVENT
Change in FONTS that may cause a font query to now give a different result.

Traits§

HyphenationDataSource
Represents a hyphenation dictionary source.
OutlineSink
Receives Bézier path rendering commands from Font::outline.

Functions§

f32_cmp
f32 comparison, panics for NaN.
unicode_bidi_levels
Compute initial bidirectional levels of each segment of a line.
unicode_bidi_sort
Compute a map of segments in line to their final LTR display order.

Type Aliases§

FontSize
Text font size.
LetterSpacing
Extra spacing added in between text letters.
LineHeight
Text line height.
LineSpacing
Extra spacing in-between text lines.
ParagraphSpacing
Extra spacing in-between paragraphs.
TabLength
Length of a TAB space.
TextLineThickness
Height of the text overline or strikethrough decoration.
UnderlineThickness
Height of the text underline decoration.
WordSpacing
Extra spacing added to the Unicode U+0020 SPACE character.