go-text / typesetting

High quality text shaping in pure Go.
Other
88 stars 11 forks source link

Better space handling ? #103

Closed benoitkugler closed 7 months ago

benoitkugler commented 8 months ago

Following the discussion on #90 , this is a try at better handling trailing spaces.

This is not complete (tests are not event passing), but I would be interested in early feedback.

One of the difficulty is about handling truncation properly : I think the behavior should be, for a width of 5, to truncate quick_fox to quick_... (but with a zero advance space) and not to quick...

benoitkugler commented 8 months ago

@whereswaldon I've adjusted some tests in TestLineWrapperBreakSpecific. I think the new output values are fine, but I also think some of the tests may not be as informative as previously, with respect to the BreakPolicy option. When you have some time, would it be possible for you to carefully review these changes ?

whereswaldon commented 7 months ago

@whereswaldon I've adjusted some tests in TestLineWrapperBreakSpecific. I think the new output values are fine, but I also think some of the tests may not be as informative as previously, with respect to the BreakPolicy option. When you have some time, would it be possible for you to carefully review these changes ?

@benoitkugler Done! I've fixed up two tests to ensure that they still check the right things. Looks good to me now.

benoitkugler commented 7 months ago

@benoitkugler Done! I've fixed up two tests to ensure that they still check the right things. Looks good to me now.

Many thanks !