From 0210f793076f200cb7ed877ccf9479da682c9501 Mon Sep 17 00:00:00 2001 From: Diego Muracciole Date: Fri, 1 Mar 2019 15:05:34 -0300 Subject: [PATCH] Fix ligatures at the end of paragraph (#512) --- src/layout/linebreaker/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layout/linebreaker/index.js b/src/layout/linebreaker/index.js index 866fdb4f2..26eb6fe2b 100644 --- a/src/layout/linebreaker/index.js +++ b/src/layout/linebreaker/index.js @@ -79,7 +79,10 @@ export default ({ penalty } = {}) => () => { return [...acc, line]; }, []); - const lastLine = glyphString.slice(start, glyphString.length); + const lastLine = glyphString.slice( + start, + glyphString.glyphIndexForStringIndex(glyphString.string.length), + ); lines.push(lastLine); return lines;