Crate owned_ttf_parser

Source
Expand description

Extends ttf_parser with owned version of Face: OwnedFace.

Re-exports ttf_parser::*.

§Example

use owned_ttf_parser::{AsFaceRef, Face, OwnedFace};

let owned_face = OwnedFace::from_vec(owned_font_data, 0).unwrap();
let face_ref: &Face<'_> = owned_face.as_face_ref();

assert_eq!(face_ref.ascender(), 2254);

Modules§

ankr
An Anchor Point Table implementation.
apple_layout
This module contains Apple Advanced Typography Layout supplementary tables implementation.
avar
An Axis Variations Table implementation.
cbdt
A Color Bitmap Data Table implementation.
cblc
A Color Bitmap Location Table implementation.
cff
A Compact Font Format Table implementation.
cff2
A Compact Font Format 2 Table implementation.
cmap
A Character to Glyph Index Mapping Table implementation.
colr
A Color Table implementation.
cpal
A Color Palette Table implementation.
feat
A Feature Name Table implementation.
fvar
A Font Variations Table implementation.
gdef
A Glyph Definition Table implementation.
glyf
A Glyph Data Table implementation.
gpos
A Glyph Positioning Table implementation.
gsub
A Glyph Substitution Table implementation.
gvar
A Glyph Variations Table implementation.
head
A Font Header Table implementation.
hhea
A Horizontal Header Table implementation.
hmtx
A Horizontal/Vertical Metrics Table implementation.
hvar
A Horizontal Metrics Variations Table implementation.
kern
A Kerning Table implementation.
kerx
An Extended Kerning Table implementation.
loca
An Index to Location Table implementation.
math
A Math Table implementation.
maxp
A Maximum Profile Table implementation.
morx
An Extended Glyph Metamorphosis Table implementation.
mvar
A Metrics Variations Table implementation.
name
A Naming Table implementation.
name_id
A list of name ID’s.
opentype_layout
This module contains OpenType Layout supplementary tables implementation.
os2
A OS/2 and Windows Metrics Table implementation.
post
A PostScript Table implementation.
sbix
A Standard Bitmap Graphics Table implementation.
stat
A Style Attributes Table implementation.
svg
An SVG Table implementation.
trak
A Tracking Table implementation.
vhea
A Vertical Header Table implementation.
vorg
A Vertical Origin Table implementation.
vvar
A Vertical Metrics Variations Table implementation.

Structs§

Face
A font face.
FaceTables
Parsed face tables.
Fixed
A 32-bit signed fixed-point number (16.16).
GlyphId
A type-safe wrapper for glyph ID.
LazyArray16
A slice-like container that converts internal binary data only on access.
LazyArray32
A slice-like container that converts internal binary data only on access.
LazyArrayIter16
An iterator over LazyArray16.
LazyArrayIter32
An iterator over LazyArray32.
LineMetrics
A line metrics.
NormalizedCoordinate
A variation coordinate in a normalized coordinate system.
OwnedFace
An owned version of font Face.
PhantomPoints
Phantom points.
PointF
A float point.
PreParsedSubtables
A Face with cmap & kern subtables parsed once on initialization.
RasterGlyphImage
A glyph’s raster image.
RawFace
A raw font face.
RawFaceTables
A list of all supported tables as raw data.
Rect
A rectangle.
RectF
A rectangle described by the left-lower and upper-right points.
RgbaColor
A RGBA color in the sRGB color space.
ScriptMetrics
A script metrics used by subscript and superscript.
TableRecord
A raw table record.
Tag
A 4-byte tag.
Transform
An affine transform.
UnicodeRanges
Unicode Ranges.
Variation
A font variation value.
VariationAxis
A variation axis.

Enums§

CFFError
A list of errors that can occur during a CFF glyph outlining.
FaceParsingError
A list of font face parsing errors.
Language
A Name language.
Permissions
Face permissions.
PlatformId
A platform ID.
RasterImageFormat
A glyph raster image format.
Style
A face style.
Weight
A face weight.
Width
A face width.

Traits§

AsFaceRef
Used to perform a cheap conversion to a Face reference.
FaceMut
Trait exposing mutable operations on a ttf_parser::Face.
FromData
A trait for parsing raw binary data of fixed size.
OutlineBuilder
A trait for glyph outline construction.

Functions§

fonts_in_collection
Returns the number of fonts stored in a TrueType font collection.