HaikuArchives / ArtPaint

ArtPaint is a painting and image processing program.
https://haikuarchives.github.io/ArtPaint/
29 stars 18 forks source link

Text tool: Use "Insert text..." (Layer menu) as tool setup window #157

Open humdingerb opened 2 years ago

humdingerb commented 2 years ago

Currently, the tool setup window of the Text tool says: "No configuration options available". If you select "Layer | Insert text..." a window appears with those option. The Text tool should just show this window.

IMO, the "Insert text..." item in the Layer menu could as well be removed. The only thing it does compared to using the Text tool directly is create a new layer for it. If I wanted the text in its own layer, I could create one quickly before I use the Texxt tool. Strike that, while playing around with the "Insert text" it doesn't create a new layer anymore. I was quite sure that it did before... Anyhoo, away with it! :)

dsizzle commented 2 years ago

Yes, I thought it's strange that the "text tool" isn't the same as the..."insert text" tool. I agree we should combine the two.

PeteCA commented 2 years ago

Currently, the tool setup window of the Text tool says: "No configuration options available". If you select "Layer | Insert text..." a window appears with those option. The Text tool should just show this window. Yeah -- I find the Text tool behaviour a ljttle odd. I notice that if you select it and then click on the canvas, the normal setup window appears, but that window retains any text that was previously entered, and the click inserts a copy at the click point (which may well be obscured by the setup window!). Actually sometimes you may have to click OK for the text to appear. Hmm, OK -- it seems that if you don't select Layer->Insert Text before selecting the text tool, you don't ever get anything except "No configuration options available". All very arbitrary... (:-))

Incidentally, the text seems to retain its own colour, unless you use the colour window before clicking OK

IMO, the "Insert text..." item in the Layer menu could as well be removed. I think so too. Strike that, while playing around with the "Insert text" it doesn't create a new layer anymore. I was quite sure that it did before... Anyhoo, away with it! :) I don't ever remember that being the case. (I'm still using the old version 2.1.2.)

dsizzle commented 1 year ago

I’ve been trying to think about what to do about text for a while now. I have a branch where I moved everything to the tool setup window, but Text doesn’t work as a “tool” - a “tool” is like capturing the mouse, changing pixels, then releasing the mouse and forgetting about the pixels you just changed - like a paintbrush in real life only with the ability to undo. So moving the options to Tool Setup makes the Text tool into a “text stamper” which isn’t what we want.

Text needs to be an “object” that you can edit later and only rasterize when you’re done, as you know, and ArtPaint doesn’t have anything else like that. I really don’t want to go down that road for Artpaint; that’s the domain of tools like Wonderbrush where everything is a selectable object.

That’s why text is currently a manipulator, because you can have a window of time to make changes before it’s committed to pixels. Unfortunately it still doesn’t really solve it.

my current thought is to make a special Text Layer type of Layer where only Text can live and be manipulated as text. Such a layer could be rasterized into a normal Layer if desired. This doesn’t feel trivial at all though, which is why I’m avoiding it for the moment.

humdingerb commented 1 year ago

my current thought is to make a special Text Layer type of Layer where only Text can live and be manipulated as text. Such a layer could be rasterized into a normal Layer if desired. This doesn’t feel trivial at all though, which is why I’m avoiding it for the moment.

The new text layer would be like a normal layer, but with a flag "I'm a text layer". The user configured text is rasterized into the layer like usual to have it visible on the canvas. Additionally, the text parameters are saved with the layer (position, formatting, font, size, shear etc.). If the text layer is selected and the user chooses the Text tool, the parameters are read from the layer and can be manipulated by the user. Whenever the user chooses an add-on or tries to manipulate the text layer in any way, an alert pops up

This a text-only layer. If you want to manipulate it or apply an add-on, it has to be rasterized first.
After rasterizing, you cannot change the text or its properties any more.

                                                                             [Keep text layer]       [Rasterize layer]

Then remove the "I'm a textlayer" flag and text parameters and continue applying the chosen manipulator/add-on. Same when merging layers. The alert text could be made more specific to the intended action.

Maybe that's also your line of thinking, but contrary to me, you grasp the technical diffculties...