Skip to main content

Crate oxideav_otf

Crate oxideav_otf 

Source
Expand description

Pure-Rust OpenType / CFF font parser.

Scope:

  • sfnt header + table directory walker (parser).
  • CFF (Adobe TN5176) Top DICT / Name / String INDEX / Charset / Encoding / Private DICT / Local + Global Subrs, plus CID-keyed fonts (ROS + FDArray Font DICTs + FDSelect GID→FD routing, TN5176 §§18, 19).
  • CFF2 (OpenType 1.9.1 §6–§8): header, Top DICT, GlobalSubrINDEX, CharStringINDEX, and FontDICTINDEX walks (the cff2 module defers variation-aware charstring decoding to a later round).
  • Type 2 charstring interpreter (Adobe TN5177): every common path construction operator, the four flex variants, the deprecated four-operand seac endchar, hint-recording stubs (no enforcement; we anti-alias at >= 16 px), and subroutine resolution with the well-known 107 / 1131 / 32768 bias formula.
  • Selected sfnt tables for metadata (head, hhea, maxp, hmtx, cmap formats 0/4/6/12, name, post, OS/2, GDEF, and the GSUB / GPOS headers with their ScriptList / FeatureList / LookupList walks).

The crate is read-only (parsing-only) and dependency-light: only oxideav-core for shared types. CFF2 charstring decoding (with blend / vsindex resolution against the VariationStore), per-glyph hinting interpretation, advanced GSUB/GPOS, and Bidi are deferred.

See README.md for a tour of the public API.

Re-exports§

pub use cff::PrivateHints;
pub use cff::RegistryOrdering;
pub use cff::TopMetadata;
pub use cff2::Cff2;
pub use cff2::Cff2Header;
pub use cff2::Cff2Op;
pub use cff2::Cff2TopDict;
pub use cff2::ItemVariationData;
pub use cff2::ItemVariationStore;
pub use cff2::RegionAxisCoordinates;
pub use cff2::VariationRegion;
pub use cff2::DEFAULT_FONT_MATRIX;
pub use outline::BBox;
pub use outline::CubicContour;
pub use outline::CubicOutline;
pub use outline::CubicSegment;
pub use outline::Point;
pub use crate::tables::gdef::AttachList;
pub use crate::tables::gdef::AttachPoint;
pub use crate::tables::gdef::CaretValue;
pub use crate::tables::gdef::ClassDef;
pub use crate::tables::gdef::Coverage;
pub use crate::tables::gdef::CoverageIter;
pub use crate::tables::gdef::GlyphClass;
pub use crate::tables::gdef::LigCaretList;
pub use crate::tables::gdef::LigGlyph;
pub use crate::tables::gdef::MarkGlyphSets;
pub use crate::tables::gpos::GposTable as GposView;
pub use crate::tables::gpos::ExtensionPos;
pub use crate::tables::gpos::PairPos;
pub use crate::tables::gpos::PairPosIter;
pub use crate::tables::gpos::PairValue;
pub use crate::tables::gpos::SinglePos;
pub use crate::tables::gpos::SinglePosIter;
pub use crate::tables::gpos::ValueFormat;
pub use crate::tables::gpos::ValueRecord;
pub use crate::tables::gpos::GPOS_LOOKUP_TYPE_CHAINED_CONTEXT;
pub use crate::tables::gpos::GPOS_LOOKUP_TYPE_CONTEXT;
pub use crate::tables::gpos::GPOS_LOOKUP_TYPE_CURSIVE;
pub use crate::tables::gpos::GPOS_LOOKUP_TYPE_EXTENSION;
pub use crate::tables::gpos::GPOS_LOOKUP_TYPE_MARK_TO_BASE;
pub use crate::tables::gpos::GPOS_LOOKUP_TYPE_MARK_TO_LIGATURE;
pub use crate::tables::gpos::GPOS_LOOKUP_TYPE_MARK_TO_MARK;
pub use crate::tables::gpos::GPOS_LOOKUP_TYPE_PAIR;
pub use crate::tables::gpos::GPOS_LOOKUP_TYPE_SINGLE;
pub use crate::tables::gsub::GsubTable as GsubView;
pub use crate::tables::gsub::AlternateGlyphIter;
pub use crate::tables::gsub::AlternateSet;
pub use crate::tables::gsub::AlternateSubst;
pub use crate::tables::gsub::AlternateSubstIter;
pub use crate::tables::gsub::ExtensionSubst;
pub use crate::tables::gsub::Ligature;
pub use crate::tables::gsub::LigatureComponentIter;
pub use crate::tables::gsub::LigatureSet;
pub use crate::tables::gsub::LigatureSubst;
pub use crate::tables::gsub::LigatureSubstIter;
pub use crate::tables::gsub::MultipleSubst;
pub use crate::tables::gsub::MultipleSubstIter;
pub use crate::tables::gsub::Sequence;
pub use crate::tables::gsub::SequenceGlyphIter;
pub use crate::tables::gsub::SingleSubst;
pub use crate::tables::gsub::SingleSubstIter;
pub use crate::tables::gsub::GSUB_LOOKUP_TYPE_ALTERNATE;
pub use crate::tables::gsub::GSUB_LOOKUP_TYPE_CHAINED_CONTEXT;
pub use crate::tables::gsub::GSUB_LOOKUP_TYPE_CONTEXT;
pub use crate::tables::gsub::GSUB_LOOKUP_TYPE_EXTENSION;
pub use crate::tables::gsub::GSUB_LOOKUP_TYPE_LIGATURE;
pub use crate::tables::gsub::GSUB_LOOKUP_TYPE_MULTIPLE;
pub use crate::tables::gsub::GSUB_LOOKUP_TYPE_REVERSE_CHAINED_SINGLE;
pub use crate::tables::gsub::GSUB_LOOKUP_TYPE_SINGLE;
pub use crate::tables::layout::Feature;
pub use crate::tables::layout::FeatureList;
pub use crate::tables::layout::FeatureListIter;
pub use crate::tables::layout::LangSys;
pub use crate::tables::layout::Lookup;
pub use crate::tables::layout::LookupFlag;
pub use crate::tables::layout::LookupList;
pub use crate::tables::layout::LookupListIter;
pub use crate::tables::layout::Script;
pub use crate::tables::layout::ScriptList;
pub use crate::tables::layout::ScriptListIter;
pub use crate::tables::layout::NO_REQUIRED_FEATURE;
pub use crate::tables::name::NameId;
pub use crate::tables::name::NameRecord;
pub use crate::tables::os2::EmbeddingPermission;
pub use crate::tables::os2::FS_SELECTION_BOLD;
pub use crate::tables::os2::FS_SELECTION_ITALIC;
pub use crate::tables::os2::FS_SELECTION_NEGATIVE;
pub use crate::tables::os2::FS_SELECTION_OBLIQUE;
pub use crate::tables::os2::FS_SELECTION_OUTLINED;
pub use crate::tables::os2::FS_SELECTION_REGULAR;
pub use crate::tables::os2::FS_SELECTION_STRIKEOUT;
pub use crate::tables::os2::FS_SELECTION_UNDERSCORE;
pub use crate::tables::os2::FS_SELECTION_USE_TYPO_METRICS;
pub use crate::tables::os2::FS_SELECTION_WWS;
pub use crate::tables::os2::FS_TYPE_BITMAP_EMBEDDING_ONLY;
pub use crate::tables::os2::FS_TYPE_EDITABLE;
pub use crate::tables::os2::FS_TYPE_NO_SUBSETTING;
pub use crate::tables::os2::FS_TYPE_PREVIEW_AND_PRINT;
pub use crate::tables::os2::FS_TYPE_RESTRICTED_LICENSE;
pub use crate::tables::os2::FS_TYPE_USAGE_MASK;
pub use crate::tables::post::PostFormat;

Modules§

agl
Adobe Glyph List (AGL) — the canonical PostScript glyph-name to Unicode-scalar-value mapping shipped by Adobe.
cff
CFF (Compact Font Format) parser — Adobe Technical Note #5176.
cff2
CFF2 — Compact Font Format Version 2 (OpenType 1.9.1 CFF2 table).
outline
Cubic-Bezier outline data structures emitted by the Type 2 charstring interpreter.
parser
sfnt header + table directory parser.
tables
sfnt table parsers (the parts an OTF/CFF font shares with TTF).

Structs§

Font
A parsed OpenType / CFF font, lifetime-bound to the input bytes.

Enums§

Error
Errors emitted during font parsing or glyph lookup.