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
Rich text editor #2723
Comments
Thank you for your suggestion. Rich text is definitely something we want to provide in the future. From technical side one way we could archive it, is to make use of cosmic-text in slint https://github.com/pop-os/cosmic-text. An other point we need to think about is how rich text should be defined in the slint language. |
I do like cosmic, but it doesn't support rich text, does it? We'd still need to build that support ourselves. As for the second point, that's the main thing holding us up. If we assume an editor with a large amount of text, re-creating it from an rtf file or similar every time it's changed would be slow. We need some other way to store it in slint lang. |
Hey everyone! I tried multiple Rust libraries for GUI and stopped on Slint for my next app. As many others in Rust community looking for GUI libraries, I also need rich text editor (actually, at least syntax highlighting). And I found that you considered making your own editor, because you thought cosmic-text lacks rich text. But it actually does support it (well, not in a document form, but it has attributes on top of each the document format could be implemented), so I think integrating cosmic-text wouldn't be as much work as it were with your own implementation. You can check an example here: https://github.com/pop-os/cosmic-text/blob/main/examples/rich-text/src/main.rs |
Hey @ales-tsurko. Thank you for your feedback. Yes we know that |
I tried to read about the technologies mentioned earlier and some others. I also know about html, bbcode, mdast and they look like cosmic-text. In general they all use the same concept. They represent rich text as sequence1 of pairs (string, formatting attributes). What about QTextDocument, it looks like it uses the same concept and even looks like it organizes the whole text document as mdast do it. It not just gives you a bunch of text it gives you a tree of nodes where leaves is the text but other nodes are structuring containers for text (lists, tables, sequence of paragraphs that contains text). The only thing that bothers me in that is that it also has QSyntaxHighlighter and I don't know how it works. Does it parse text and create from it text blocks with different formatting? Maybe but I don't know... My summary will be: "They are all about the same concept and it looks like it is the most efficient way to make rich text" Footnotes
|
Hello, where can it be found? I need it even if it is raw and bad... |
The |
Hello, A few thoughts.
I both cases, you create a rich text editor the way you want. Commonality with Cosmic is well and good if all the participants share the same goals. Different specs can create frictions and forks (at best) or force you to create another crate altogether (the worst, since you already lost time and energy in the first crate). Some (non-Rust) UI frameworks uses the OS implementation of Core Text (iOs), DirectWrite(Windows), ... Maybe not a good solution since Slint is focused on embedded devices. What do you think ? |
We need something like #1325 (a data model) before we can add support for rich text. In scope are the necessary APIs to allow users to implement rich text editors. A GUI in Slint for rich text editing itself (controls for formatting) is not in scope. |
I second this. I think we may be able to close this issue, or retire it for now, in favor of the one you mentioned, as that one seems to have encompassed the goals of this one. Leaving the choice of whether or not to close it to one of you guys. |
follow with interest |
Goals
A rich text editor that can support different colors, font families, styles and sizes, all inline with each other, efficiently.
Steps
.slint
files.This is mostly an issue for me to keep track of my progress. CC @hunger.
Edit (Simon): The acceptance criteria here is to have all the APIs/enablers in place in Slint to permit developers to create (simple) rich text editing capabilities in their applications. We don't need to impose a concrete UI on the editing itself.
The text was updated successfully, but these errors were encountered: