def ttf.walk
gralha-truetype@0.1.0.1 · font.bend:443
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
443def ttf.walk(pts: List<&2, TTPoint>, +pending: Maybe<&2, TTPoint>, +start: TTPoint) -> String:
444 match pts:
445 case Nil{}: ttf.walk.close(pending, start)
446 case Con{TTPoint{x, y, on}, rest}:
447 +px = x
448 +py = y
449 +r = rest
450 U.branch(String, on,
451 _ => ttf.walk.on(TTPoint{px, py, True{}}, pending) ++ ttf.walk(r, None{}, start),
452 _ => ttf.walk.off(TTPoint{px, py, False{}}, pending) ++ ttf.walk(r, Some{TTPoint{px, py, False{}}}, start))