main
Matthew Butterick 5 years ago
parent edf747bf18
commit 611aeaedc8

@ -38,12 +38,11 @@ https://github.com/mbutterick/fontkit/blob/master/src/glyph/Glyph.js
(FT_Load_Glyph face (glyph-id g) FT_LOAD_NO_RECURSE)
(define glyph (FT_FaceRec-glyph face))
(define ft-glyph-metrics (FT_GlyphSlotRec-metrics glyph))
#R (FT_Glyph_Metrics->list ft-glyph-metrics)
(set-glyph-metrics! g (mhash))
(hash-set*! (glyph-metrics g)
'advanceWidth (FT_Glyph_Metrics-horiAdvance ft-glyph-metrics)
'leftBearing (FT_Glyph_Metrics-horiBearingX ft-glyph-metrics)))
#R (glyph-metrics g))
(glyph-metrics g))
(define (+ttf-glyph . args)
(apply +glyph #:constructor ttf-glyph args))

@ -315,7 +315,8 @@
-> (cond
[(zero? err)
;; see https://www.freetype.org/freetype2/docs/tutorial/step1.html
;; for meaning of these arguments
(FT_Set_Char_Size ftf 0 1000 0 0)
ftf]
[(= err 1)
(error 'FT_New_Face (format "font ~v not found" path))]

Loading…
Cancel
Save