structify glyphrun

main
Matthew Butterick 6 years ago
parent 67b32f7254
commit 8bb5b6d1c9

@ -54,7 +54,7 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/font/embedded.coffee
(list string size (and features (sort features symbol<?)))
(λ ()
(define run (send (· this font) layout string features))
(define width (· run advanceWidth))
(define width (advanceWidth run))
(define scale (/ size (+ (· this font unitsPerEm) 0.0)))
(* width scale))))
@ -65,10 +65,10 @@ https://github.com/mbutterick/pdfkit/blob/master/lib/font/embedded.coffee
(list/c (listof string?) (listof GlyphPosition?)))
#;(report*/file 'starting-layout-in-embedded (description (· this font)))
(define glyphRun (send (· this font) layout text features))
(define glyphs (· glyphRun glyphs))
(define glyphs (glyphrun-glyphs glyphRun))
(for ([g (in-list glyphs)])
(· g id))
(define positions (· glyphRun positions))
(define positions (glyphrun-positions glyphRun))
#;(report/file (for/list ([p (in-list positions)])
(list (· p xAdvance) (· p xOffset))))
(define-values (subset-idxs new-positions)

Loading…
Cancel
Save