This commit builds upon #44 to actually implement a text truncator symbol.
Some design choices:
I tried to implement what we discussed in #28 towards the end of the thread.
The Truncator is a single Output. This limits it to being a single font face, size, script, and language, though it can contain any number of glyphs. Supporting a []Output truncator is a solid complexity hike, and I'm not sure that they are really used in practice.
To make it easier to populate the Truncator field, I've provided a helper on WrapConfig that accepts a Shaper and Input.
Applications often want to know how much of the string was truncated. I've made this an additional return value from the wrapping functions because I didn't see a clearer way to communicate it right now.
Only the final commit in this PR is new. Please focus review on that and review the rest on #44
This commit builds upon #44 to actually implement a text truncator symbol.
Some design choices:
Truncator
is a singleOutput
. This limits it to being a single font face, size, script, and language, though it can contain any number of glyphs. Supporting a[]Output
truncator is a solid complexity hike, and I'm not sure that they are really used in practice.Truncator
field, I've provided a helper onWrapConfig
that accepts aShaper
andInput
.Only the final commit in this PR is new. Please focus review on that and review the rest on #44