diff --git a/fontland/fontland/glyphrun.rkt b/fontland/fontland/glyphrun.rkt index f4addd29..48b17870 100644 --- a/fontland/fontland/glyphrun.rkt +++ b/fontland/fontland/glyphrun.rkt @@ -16,6 +16,9 @@ https://github.com/mbutterick/fontkit/blob/master/src/layout/GlyphRun.js ; An array of GlyphPosition objects for each glyph in the run (struct glyphrun (glyphs positions) #:transparent) +(define (+glyphrun [glyphs null] [positions null]) + (glyphrun glyphs positions)) + (define (glyphrun-advance-width gr) (for/sum ([pos (in-list (glyphrun-positions gr))]) (glyph-position-x-advance pos))) @@ -32,6 +35,6 @@ https://github.com/mbutterick/fontkit/blob/master/src/layout/GlyphRun.js (module+ test (require rackunit) - (define gr (glyphrun null null)) + (define gr (+glyphrun)) (check-true (glyphrun? gr)) (check-equal? (append-glyphruns gr gr) gr))