def ttf.contour

gralha-truetype@0.1.0.1 · font.bend:481

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

481def ttf.contour(pts: List<&2, TTPoint>) -> String:
482  match pts:
483    case Nil{}: ""
484    case Con{TTPoint{x, y, on}, rest}:
485      +fx = x
486      +fy = y
487      +r = rest
488      U.branch(String, on,
489        _ => "M" ++ ttf.pair(TTPoint{fx, fy, True{}}) ++ ttf.walk(r, None{}, TTPoint{fx, fy, True{}}),
490        _ => ttf.contour.off(TTPoint{fx, fy, False{}}, r))

Uses (10)

Used by (1)