def ttf.place.offset

gralha-truetype@0.1.0.1 · font.bend:288

import gralha-truetype@0.1.0.1/font.bend as Font
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

288def ttf.place.offset(+parent: TTGlyph, +child: TTGlyph, +place: TTPlace) -> F32 & F32:
289  TTPlace{xy, a1, a2, scaledOffset, a, bb, c, d} = place
290  +a2Dup = a2
291  +a1Dup = a1
292  U.branch(F32 & F32, xy,
293    _ => U.choose(F32 & F32, scaledOffset, ((a * a1Dup + c * a2Dup : F32), (bb * a1Dup + d * a2Dup : F32)), (a1Dup, a2Dup)),
294    _ => ttf.matched(ttf.xy(ttf.point(ttf.glyph.points(parent), U32.to_nat(F32.to_u32(a1Dup)))), ttf.xy(ttf.point(ttf.glyph.points(child), U32.to_nat(F32.to_u32(a2Dup))))))

Uses (15)

Used by (1)