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

[Text Server] Add support for user defined punctuation list, used for word breaking. #46721

Merged
merged 1 commit into from
Nov 8, 2021

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Mar 6, 2021

Adds support for user defined punctuation list, used for word breaking. This PR does not affect spaces and dictionary based breaking, or change any defaults and therefor is not superseding #46691.

Usage example:

var a = TextParagraph.new()
a.custom_punctuation = "R"
a.add_string("test.test_testRtest test", get_theme_font("font"), 16)
print("A: ", TextServerManager.get_primary_interface().shaped_text_get_word_breaks(a.get_rid()))
#A: [(0, 14), (15, 19), (20, 24)]

var b = TextParagraph.new()
b.add_string("test.test_testRtest test", get_theme_font("font"), 16)
print("B: ", TextServerManager.get_primary_interface().shaped_text_get_word_breaks(b.get_rid()))
#B: [(0, 4), (5, 9), (10, 19), (20, 24)]

Bugsquad edit: This closes #29789.

@bruvzg bruvzg force-pushed the custom_word_break_punct branch from 4238a40 to daa6133 Compare October 1, 2021 13:46
@akien-mga akien-mga merged commit 5968653 into godotengine:master Nov 8, 2021
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement subword navigation option in the script editor
3 participants