Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shaping] add support for custom letter and word spacing #165

Merged
merged 4 commits into from
May 22, 2024
Merged

Conversation

benoitkugler
Copy link
Contributor

This is a revisited version of #90.

The proposed API consists of two methods Output.AddWordSpacing() and Output.AddLetterSpacing() and a convenient function AddSpacing accepting a slice of Outputs.

I've exported the Output methods so that it may be used by external implementation of RunIterator.

Implementation note : by registering the letter spacing in a new Glyph field, the line wrapper is able to trim edge spacing on its own, without requiring the user to "clean up" the runs after wrapping.

What do you think ?

Copy link
Member

@whereswaldon whereswaldon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @benoitkugler, this looks great! I have a very minor request.

shaping/spacing_test.go Outdated Show resolved Hide resolved
shaping/wrapping.go Outdated Show resolved Hide resolved
Copy link
Member

@whereswaldon whereswaldon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Contributor

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool addition

@benoitkugler benoitkugler merged commit 2c04547 into main May 22, 2024
20 checks passed
@benoitkugler benoitkugler deleted the spacing branch May 22, 2024 21:01
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.

None yet

3 participants