Conversation
4cee364 to
c48f7f0
Compare
|
Regarding the risk of diverging use cases for the upstream google-funded components (fontations in particular): Swash itself is likely, in time, to be replaced in Parley with RustyBuzz/Harfruzz (when the port to fontations from ttf-parser is done), and HarfBuzz (along with its ports) is again intended to cover the overwhelming majority of shaping use cases, though conceivably could fall short on very exotic shaping requirements (e.g. shaping byzantine music notation or con-scripts). Thank you for taking on this task. It is exciting to see interest in adopting Parley, and your work has already shaken a lot of dust out. :+ ) |
|
This is very exciting - thanks for working on this! Let me know if I can help somehow, e.g. if you want to talk things through. |
d27e925 to
cef4a03
Compare
Thanks for the feedback! I've just landed a revert of that in linebender/parley#307 so now Parley's next release will still have an MSRV of 1.82 as the current release does. |
acef4ff to
9a85210
Compare
|
I'm now mainly working on the text styling API. It's a bit hard to untangle everything, since there are several different places where text style properties are stashed, each exposing a different API surface:
Parley unlocks some new options for font styling, and also changes the semantics of font styling a bit:
I ran into some issues when trying to map the existing text style API onto Parley. First up, which new font properties should be part of However, italics are currently in If we take that to its conclusion, why not just flatten all the font settings then? Have one big "all of the font style settings" type, and make it overridable CSS-style. I'm not sure yet what this API would look like exactly. I'm also not sure which parts of this new API I can punt on right now, and which ones must be implemented. |
|
My inclination is to punt on as many things as you can, and save it for a future PR. Better to break things into small pieces. The existing API is indeed all over the place, and partially a result of legacy, and partially a result of technical limitation (e.g. the fake italics). Worth mentioning is that font fallbacks is currently implemented in egui here. Moving italics into The rest of the attributes in |
898e1f7 to
cb5284c
Compare
|
Things are progressing well; just need to land some Parley changes and clean up the code. There are some issues that might change the API more significantly:
Also, a question: is there any actual difference between |
I agree with you here - let's drop serde-support for
To explain let mut start_text = String::new("Already \n multiline");
ui.text_edit_singleline(&mut start_text);How should egui handle the existing Possible alternative solutions include: Since this is such a niche corner case, I'm happy with any of these solutions.
Yes.
These were added to match the baseline of normal text and emojis (iirc). As long as we can still do that reasonably well, do whatever change you want 👍 In summary: I'm fine with this breaking API, behavior, and rendering in small ways. The wins will outweigh those minor annoyances imho! |
|
@valadaptive btw, let me know if I can help by talking things through on Discord with you! |
|
Discord would be great! My username there is the same as here. I see that #5411 just got merged--that's going to involve a major rearchitecture of the work so far, possibly to the point of creating a new branch and manually redoing however much of what I've done so far is still relevant. It may take a while to get around to that; I'm working on some upstream Parley stuff right now. |
67a8e1b to
c756e3c
Compare
Now that we don't need to share it among a bunch of `Font`s, it can be solely owned by the `FontStore`.
Even though we disabled quantization, clamping the metrics messes us up.
Hopefully this one is a bit more actionable
|
Preview available at https://egui-pr-preview.github.io/pr/5784-parley-2 |
|
Was excited to learn about this PR today! (bold! better italics! Color emoji! variable fonts! ❤️❤️) I briefly tried out the preview here and saw a minor issue w/ rendering source code links:
If there are any pieces you can think would be easy to independently tackle to unblock this, I'd be happy to help. I have the same username in the Discord if you'd like to ping me there. |
|
https://github.com/linebender/parley/releases/tag/v0.6.0 👀
|
|
An update on this: I was supposed to receive funding to work on a rework of Parley's API to make it more suitable for this project and others like it, but that never materialized. At this point, I'm more likely to just go directly to the underlying APIs (skrifa, HarfRust, and whatever rasterizer I end up going with) and wire those into egui. To an outside observer, it probably looks like this PR is 90% of the way there and just needs that last 10%, but unfortunately that last 10% is basically impossible considering how Parley's API is structured. It really wants to be given a full rectangle that it can arrange text inside, however it wants, and egui really doesn't work with that model. This PR uses a lot of workarounds to try to hide that, but they aren't reliable. There have been a few Parley proposals to make its API even more convoluted in order to support some of this stuff, but I have doubts about those working for egui. |
|
Thank you for working on this. Mentioning/Pinging this PR when/if your new approach starts materializing would be appreciated, so those of us watching from here can follow along. I'm holding off trying GUI in Rust, despite using it for almost everything else, because I want to experiment with all the big-name crates first, and fancy text shaping is a requirement for me. |

FontTweak#4644 (superseded)This is very WIP and currently a proof-of-concept. I'm sharing it here so I can ask questions about the API and have something to point to if I need to merge any supporting changes.
Right now, all I have done is basic text rendering. Pretty much everything else still needs to be implemented.
You can see in the commit history that my first pass at this did use Cosmic Text. However, Parley's API surface seems to mesh much better with how egui wants to do things. I ran into a lot of limitations with Cosmic Text that will have to be solved before it's ready for this use case:
Cosmic Text issues
leading_spaceinLayoutSection.Buffer, not the ones in any particular text span. This means that in e.g. the EasyMark Editor example, where there's mixed-size text, you need to pass the "default" font all the way down, and even then, you might still want different blank lines to have different heights (Empty lines at the start/end of a span should use that span's line height pop-os/cosmic-text#364).Buffertriggers one relayout per property being set (Make reshaping/relayouting when inputs change lazy pop-os/cosmic-text#280).Buffer.There are some drawbacks to Parley as well:
parley-todo.md).There is no guarantee that I'll finish this PR; if you ping me and I respond with something like "sorry, I'll get around to it next week" a few times in a row, feel free to take over it yourself.
I'm tracking progress in more detail via
parley-todo.mdin the root folder, but as an overview, this work can be split into three main parts:max_rows)FontDefinitionson top of Parley