From 6b283bc11a5384d211b844722d8602a75a014298 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 6 Mar 2019 21:42:27 -0800 Subject: [PATCH] next: path extraction --- fontland/fontland/glyph.rkt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fontland/fontland/glyph.rkt b/fontland/fontland/glyph.rkt index 40ea375e..f2bdc192 100644 --- a/fontland/fontland/glyph.rkt +++ b/fontland/fontland/glyph.rkt @@ -35,13 +35,16 @@ https://github.com/mbutterick/fontkit/blob/master/src/glyph/Glyph.js (define (get-glyph-metrics g) (unless (glyph-metrics g) (define face (ft-face (glyph-font g))) - (FT_Load_Glyph face (glyph-id g) FT_LOAD_NO_RECURSE) + (FT_Load_Glyph face (glyph-id g)) (define glyph (FT_FaceRec-glyph face)) (define ft-glyph-metrics (FT_GlyphSlotRec-metrics glyph)) (set-glyph-metrics! g (mhash)) + ;; todo: get vertical metrics (hash-set*! (glyph-metrics g) 'advanceWidth (FT_Glyph_Metrics-horiAdvance ft-glyph-metrics) - 'leftBearing (FT_Glyph_Metrics-horiBearingX ft-glyph-metrics))) + 'leftBearing (FT_Glyph_Metrics-horiBearingX ft-glyph-metrics) + 'advanceHeight 'unfinished + 'topBearing 'unfinished)) (glyph-metrics g)) (define (+ttf-glyph . args)