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

Implement cosmic_text as the text renderer and editor #179

Closed
wants to merge 3 commits into from

Conversation

msparkles
Copy link
Contributor

@msparkles msparkles commented Jul 1, 2024

Closes #95

@msparkles msparkles requested a review from LPGhatguy as a code owner July 1, 2024 16:21
@msparkles msparkles changed the title Implement cosmic_text as the text renderer and editor. Closes #95 Implement cosmic_text as the text renderer and editor Jul 1, 2024
@msparkles
Copy link
Contributor Author

msparkles commented Jul 2, 2024

image

Weird text bug on yakui demo Fixed!

@msparkles
Copy link
Contributor Author

Unsure of why the tests are failing!

@msparkles
Copy link
Contributor Author

msparkles commented Jul 3, 2024

Need input on the tests

Otherwise should be ready for review!

@msparkles msparkles requested a review from LPGhatguy July 13, 2024 04:07
@msparkles
Copy link
Contributor Author

msparkles commented Jul 13, 2024

Hm! Either I'm doing something wrong here, or whatever #125 aims to fix is hitting me hard here.

It seems that if I switch to another page in my game, textboxes will happily reuse the contents of the old one selected.

@LPGhatguy
Copy link
Member

Even after #125 or a similar fix, you'll still run into that until we fix widget keys. More details in Discord!

Ideally, widgets are able to react to props changing so that it isn't a major issue to reuse widget state but sometimes that isn't possible.

@msparkles
Copy link
Contributor Author

we've made a branch that contains code to solve the issue. but it depends on this pr because we were too lazy to find a reprod on main that actually does have the issue, lol!

@msparkles
Copy link
Contributor Author

AAAaahhhhh. hi-dpi actually works now. This has become like 40 commits, god damn it

@msparkles
Copy link
Contributor Author

oops squashed them wrongly i think

@msparkles
Copy link
Contributor Author

msparkles commented Sep 24, 2024

apparently the text fixes broke the height of texts on certain fonts, so the actual thing we should've done was to change the tests 💯

@LPGhatguy LPGhatguy mentioned this pull request Nov 20, 2024
5 tasks
LPGhatguy added a commit that referenced this pull request Nov 30, 2024
* implement cosmic_text as the text renderer and editor

* fix text related tests

* fix text sizing being incorrect on certain fonts

* Re-add TextAlignment so that we don't break more code

* Restore textbox API

* Fix overflow detection; left debug prints in while I diagnose other problems

* Make PaintLimits optional because they aren't initialized right away

* Fix textbox state machine

* Working textbox state machine

* Fix up modifier keys and some warnings

* Fix alignment (which works in more cases now! O_o)

* Remove debug prints, fix cursor when buffer is empty

* Use ((x, y), (w, h)) order instead of ((x, w), (y, h)) order for coordinates

* Improve variable names since there are two 'text changed' variables now

* Re-export cosmic_text from yakui crate

* Fix tests, restore old YakuiWgpu constructor, add button alignment example

* Remove Yakui argument from boostrap, app, and demo

* Always import cosmic_text from yakui instead of yakui_widgets if available

* Restore examples and text API to use (potentially flawed) Into<String> generic

* Fix clear_textbox example

* Remove yakui_widgets references from yakui_app and bootstrap

* Clean up examples

* Borrow and initialize Option instead of taking it to prevent possible mistakes

* Triple whammy to fix button alignment — I think this is good enough

* Accept snapshots, for better or worse

---------

Co-authored-by: Madeline Sparkles <[email protected]>
@msparkles
Copy link
Contributor Author

Closed as per #194

@msparkles msparkles closed this Dec 1, 2024
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.

Investigate using Cosmic Text
2 participants