Break words in text layer when adjacent chars do not overlap vertically
For text selection to work well it is important that `<hypothesis-text-word>` elements do not span multiple lines. Previously the layout analysis only created new words after a space. Since most lines end with a whole word, this was sufficient in most cases. However this doesn't work if a word is broken across multiple lines (eg. with a hyphen). To handle this case, also create a word break if the current character does not vertically overlap the previous character. This may create some false positives (ie. unnecessary word breaks), but that doesn't harm text selection. Fixes #5066
Showing
Please register or sign in to comment