Docs.rs
  • write-fonts-0.2.0
    • write-fonts 0.2.0
    • Docs.rs crate page
    • MIT/Apache-2.0
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • cmyr
    • dfrg
    • rsheeter
    • anthrotype
    • drott
    • rictic
    • Dependencies
      • bitflags ^1.3 normal
      • font-types ^0.1.5 normal
      • kurbo ^0.9.4 normal
      • read-fonts ^0.2.0 normal
      • ansi_term ^0.12.1 dev
      • diff ^0.1.12 dev
      • env_logger ^0.10.0 dev
      • log ^0.4 dev
      • read-fonts ^0.2.0 dev
    • Versions
    • 87.35% of the crate is documented
  • Go to latest version
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Badges
    • Builds
    • Metadata
    • Shorthand URLs
    • Download
    • Rustdoc JSON
    • Build queue
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation
logo

logo

OtRound

Required Methods

  • ot_round

Implementations on Foreign Types

  • Point
  • f32
  • f32
  • f64
  • f64

Implementors

In write_fonts

?
Change settings

Trait write_fonts::OtRound

source ·
pub trait OtRound<U, T = Self> {
    // Required method
    fn ot_round(self) -> U;
}
Expand description

ot_round is defined by https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview#coordinate-scales-and-normalization.

https://github.com/fonttools/fonttools/issues/1248#issuecomment-383198166 captures the rationale for the current implementation.

Copied from https://github.com/simoncozens/rust-font-tools/blob/105436d3a617ddbebd25f790b041ff506bd90d44/otmath/src/lib.rs#L17, which is in turn copied from https://github.com/fonttools/fonttools/blob/a55a545b12a9735e303568a9d4c7e75fe6dbd2be/Lib/fontTools/misc/roundTools.py#L23.

Required Methods§

source

fn ot_round(self) -> U

Implementations on Foreign Types§

source§

impl OtRound<u16, f64> for f64

source§

fn ot_round(self) -> u16

source§

impl OtRound<i16, f32> for f32

source§

fn ot_round(self) -> i16

source§

impl OtRound<(i16, i16), Point> for Point

source§

fn ot_round(self) -> (i16, i16)

source§

impl OtRound<u16, f32> for f32

source§

fn ot_round(self) -> u16

source§

impl OtRound<i16, f64> for f64

source§

fn ot_round(self) -> i16

Implementors§