From d09e421406d4644c22bd808b09d1168ee2e1060a Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 19 Jun 2017 12:37:37 -0700 Subject: [PATCH] step3 --- pitfall/fontkit/subset.rkt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pitfall/fontkit/subset.rkt b/pitfall/fontkit/subset.rkt index 56540788..cc9ac830 100644 --- a/pitfall/fontkit/subset.rkt +++ b/pitfall/fontkit/subset.rkt @@ -57,6 +57,11 @@ https://github.com/mbutterick/fontkit/blob/master/src/subset/TTFSubset.js (index? . ->m . index?) (define glyph (send (ยท this font) getGlyph gid)) + ;; _decode unpacks the `glyf` table data corresponding to a certin gid. + ;; here, it's not necessary for non-composite glyphs + ;; because they just get copied entirely into the subset. + ;; it's just used to detect composite glyphs and handle them specially. + ;; so an optimization would be to detect composite / noncomposite without full _decode. (define glyf (send glyph _decode)) ;; get the offset to the glyph from the loca table