这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ChrisLoer
Copy link
Contributor

PR #26 prevented crashes on characters from RTL scripts, but could still mis-calculate the glyph width, leading to cut off characters. Poking around in MDN, I realized that the canvas textAlign property allows us to force all text to be laid out with left-alignment, which gives us the results the algorithm was expecting in the first place.

Before
Screen Shot 2021-01-26 at 9 39 21

After
Screen Shot 2021-01-26 at 9 38 54

@mourner

Remove previous attempt to handle right-alignment with Math.abs.
@mourner mourner merged commit d5be0d4 into master Jan 26, 2021
@mourner mourner deleted the left_align_rtl branch January 26, 2021 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants