ferroui-pretext-contracts 0.4.0

Backend contracts for prepared text and glyph output
Documentation
  • Coverage
  • 25%
    13 out of 52 items documented0 out of 1 items with examples
  • Size
  • Source code size: 31.8 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 533.1 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • wieslawsoltes/FerroUI
    190 14 19
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • wieslawsoltes

ferroui-pretext-contracts

Portable measurement and shaping contracts for the Pretext text engine.

  • IPretextTextMeasurer measures a whole string in a fixed font. Contextual advances must be included; independent character sums are insufficient for proportional typography.
  • IPretextTextMeasurerFactory creates measurers, reports availability/priority, and can expose its corresponding shaping factory.
  • IPretextTextShaper and IPretextTextShaperFactory return immutable glyph-run data, including shaped-versus-mapped status, UTF-16 clusters, positions, advances, offsets, font run indices and missing-glyph detection.
  • PretextFontParser parses the source's CSS-like pixel-size/font-family subset and generic family aliases.
  • DelegateTextMeasurerFactory adapts an existing string/font measurement function without global state.
  • PretextError expresses recoverable input/backend failures through Result.

Backend ownership uses Rc and normal Rust destruction. Assembly reflection, CLR metadata attributes and manual IDisposable emulation are unnecessary. A shaping option is a value snapshot, so caller mutation cannot alter cached results. Glyph clusters are UTF-16 code-unit offsets, not UTF-8 byte offsets.

The crate has no dependencies and forbids unsafe code. See the port report for provenance and source-to-Rust mappings. The upstream MIT notice travels with this crate in NOTICE.md.