position amiss

main
Matthew Butterick 7 years ago
parent b5855e7ee1
commit 7609fd1126

@ -124,11 +124,19 @@ https://github.com/mbutterick/fontkit/blob/master/src/opentype/GSUBProcessor.js
(set-field! ligatureComponent (list-ref (· this glyphs) i) ligatureComponent)))
;; Delete the matched glyphs, and replace the current glyph with the ligature glyph
(report* (for/list ([g (· this glyphs)]) (· g id)) (· this glyphIterator index))
(set-field! glyphs this (drop-right (· this glyphs) (length matched)))
(report (for/list ([g (· this glyphs)]) (· g id)) 'step-a)
(report matched)
(report (· this glyphIterator index))
(set-field! glyphs this (for*/fold ([gids (· this glyphs)])
([idx (in-list (reverse matched))])
(for/list ([(gid i) (in-indexed gids)]
#:unless (= idx i))
gid)))
(report (for/list ([g (· this glyphs)]) (· g id)) 'step-b)
(set-field! glyphs this (list-set (· this glyphs) (· this glyphIterator index) ligatureGlyph))
(set-field! glyphs (· this glyphIterator) (· this glyphs))
(report* (for/list ([g (· this glyphs)]) (· g id)) (· this glyphIterator index))
(report (for/list ([g (· this glyphs)]) (· g id)) 'step-c)
(report (· this glyphIterator index))
#t)]
[else #f])]
[(5) ;; Contextual Substitution

@ -88,6 +88,7 @@ https://github.com/mbutterick/fontkit/blob/master/src/opentype/ShapingPlan.js
(stage (· this font) glyphs positions)]
[(> (length stage) 0)
#;(report*/file 'shaping-plan:applying-features processor)
(report/file positions)
(report/file (send processor applyFeatures stage glyphs positions))]))))

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -9,7 +9,7 @@ make = (doc) ->
# Set the font, draw some text
doc.font('the-font')
.fontSize(100)
.text('fi', 100, 100, {width: false})
.text('Wofine', 100, 100, {width: false})
doc.end()

Binary file not shown.

@ -12,7 +12,7 @@
(send* doc
[font "the-font"]
[fontSize 100]
[text "afic" 100 100 (hash 'width #f)]))
[text "Wofine" 100 100 (hash 'width #f)]))
(define-runtime-path this "test16rkt.pdf")

Loading…
Cancel
Save