Skip to content

Conversation

@tafode
Copy link
Contributor

@tafode tafode commented May 31, 2025

I have created a very basic implementation of text boxes/labels.

What is working:

  • Creating and Editing text boxes
  • Selecting and moving them
  • Coloring the text based on the brush color. Also changing the color of the selected text boxes
  • Saving and Loading files with text boxes
  • Exporting the Labels to SVG (Not ideal, as it takes currently another font and probably also another font size.)
  • Undo / Redo of text boxes as it is implemented for Brushes.

What could be improved in the future:

  • Ordering the text, based on the creation time (At the moment Text is always on top of strokes)
  • Possibility to change text/font size
  • Text Editor UI is far from good
  • SVG Exporter could be improved with more accurate font.

This should solve the basic needs of Issue #63 .

I hope it is useful for the users and the product.

@tafode
Copy link
Contributor Author

tafode commented Sep 24, 2025

So I have fixed the merge conflict and also added the new theme change function to the text editor.

@mbrlabs this is probably also only a starting point for the full feature, but I would like to know, what you think about it.

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 26, 2025

Very nice work! I haven't looked at the code yet in detail but this already kinda works like i would expect. However i can't edit/change any text after i added it...might be broken.

Anyway, i'm gonna have a closer look this later this weekend :)

@tafode
Copy link
Contributor Author

tafode commented Sep 27, 2025

Thanks 🙂 I will check if the edit is broken, but I think it was working when I fixed the merge conflict.

Right now you need to have the Textbox Tool active and click on a Text, then the Popup should contain the text and you can edit it. Probably it would be better, that a double click with the select tool would trigger it.

The code probably needs another round of cleanup. 😅

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 27, 2025

I thought a bit more about the UI. How hard would it be to completly get rid of the dialog and do the editing directly on the canvas? Like this:

  • You activate the Text Tool and the cursor changes to a standard text-cursor
  • You click somewhere on the canvas and it adds a transparent TextEdit that you can edit normally
  • If you click away or hit esacpe the editing is done

If you want to edit it afterwards you just click on it again with the text tool active and start editing

@tafode
Copy link
Contributor Author

tafode commented Sep 27, 2025

🤔 i think it would make sense. I created an editor, that possible font/text size changes could be handled within the editor. But that could probably also be handled with selecting the text and change it then.

I can try to implement it, but it will take some time I guess. 🤔

@mbrlabs
Copy link
Owner

mbrlabs commented Sep 27, 2025

Yeah i would not worry too much about editing font size etc right now. That can be added later. Maybe even to the toolbar. The toolbar could be adaptive to only show the settings of the current tool.

I would say go for it if you want to give it a try. No worries, take your time. It's much better from a UX point of view.

@tafode
Copy link
Contributor Author

tafode commented Sep 27, 2025

Sure, I'll give it a try.

@tafode
Copy link
Contributor Author

tafode commented Nov 3, 2025

Quick update, I tried to implement it with an TextEdit, but I run in some issues with it.

  1. After the first Text Edit is created, it somehow stops to work, until the mouse is moved outside the window or a context menu is opened, after that it works as expected.
  2. When you move the mouse while typing and you hit the space bar the screen moves a long, like you pan without the text edit open.

So I have to investigate a bit more, to get the better looking solution to work.

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.

2 participants