You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Text Layout engine for the SDF Text Renderer definitely needs a serious rework. The way the code, mostly in layoutText.ts is structured is brittle, difficult to understand, relies on hacks and is prone to infinite loops (see #220). But it also comes with certain functional limitations that aren't easy to resolve with the way the code is currently structured.
Overflow Suffix Limitation
There are at least a few issues with how the overflow suffix (i.e. the truncating "..." sequence) is placed, when contain is set to 'both':
If a single word, at the beginning of a line, can't fit on a line it is not truncated
The mechanism that tries to make sure a suffix fits at the end of a line can truncate text that fits the line pefectly.
Overflow suffix may bleed off the edge of the contained box width.
Solution
The solution is a refactor that simplifies the code flow and allows for more intelligent calculation/placement of the overflow suffix.
The text was updated successfully, but these errors were encountered:
Another hack to prevent an infinite loop situation that was introduced
in v0.8.0.
I've written up an issue to address more wholistically the issues with
the SDF layout engine
- #223Fixes#220
Worth also removing the overly complex "text state" system with dynamic properties overriding. A simpler object with a dirty flag would be better as it's not directly exposed to library users.
The Text Layout engine for the SDF Text Renderer definitely needs a serious rework. The way the code, mostly in layoutText.ts is structured is brittle, difficult to understand, relies on hacks and is prone to infinite loops (see #220). But it also comes with certain functional limitations that aren't easy to resolve with the way the code is currently structured.
Overflow Suffix Limitation
There are at least a few issues with how the overflow suffix (i.e. the truncating "..." sequence) is placed, when contain is set to 'both':
Solution
The solution is a refactor that simplifies the code flow and allows for more intelligent calculation/placement of the overflow suffix.
The text was updated successfully, but these errors were encountered: