Text Tool Thread

… Are you talking about Inkscape’s ‘Clone’ Shapes? Because they don’t use that to flow text in shape…

@Papernoise , thanks for the clarifications, I’ve noted them down (as did I for @Deevad and @EyeOdin 's notes).

Oh dear…

BTW. I’m trying to stay a little dispassionate so that I can really listen to what is important. I will point out when something is absolutely not possible. But if I’m not reacting to something I’m just noting it down. The feedback up till now has been pretty useful already, but I’d still love to hear more :smiley:

4 Likes

When you place a modifier on a given shape and that modifier interacts with other shapes by targeting them. The way you get the id of the other shapes is to copy and paste those shapes into the modifier itself. This process adds the IDs to the list that can contain one or more objects.

just think it is a bad way to make the targeting their IDs.

Best way I have seen up until now is the Blender way, also by multi selecting is not bad but a bit cryptic.

1 Like

I think that’s a good approach! I’ll let you know if I have some further ideas, experiences, or inputs! Glad to hear the feedback is useful!

1 Like

Ok, so, a small update:

I’ve spend the last two weeks on the white-space fixes and text-in-shape handling, and have gotten far enough to make a proper MR. There were a number of complex things that needed to be tackled as part of it (you can now use hard breaks (pressing enter makes new line) inside text… that took me 5 days because hard breaks and other white-space has all sorts of implications), but the brunt of the work is done now:

It still has trouble with getting the padding/margin/shape-subtract to work fast and correct, but that isn’t really a text-layout problem at its core, so I’m hoping the other devs have a solution.

I will be taking some time off soonish, as all the text work is getting to me a little. I’m still very happy to hear any opinions people have on text-editing :smiling_face: .

17 Likes

Awsome, you are on your way to create the best text editor I have seen! Support for both left-right and right-left text apparently is not as easy (we could read that in your blog post) and people complain about the lack thereof easily.

Text creation

As for features, I agree with @eishiya about creating text objects on click, text frame on click drag and adding text to paths or shapes by clicking on a vector shape or path. If you have to go to a selection tool first, like @Deevad suggests, this becomes more keybosrd gymnastics. Of course, you should be able to do preselection if the shape you want to use is underneath another vector object from another layer. Generally speaking, I think the text tool should iterate from the top vecor layer to the bottom to see whether or not there’s a shape below the cursor on click. If it doesn’t detect one, try the next layer and if at the end, nothing was detected, create a new blank text object.

Tool interaction

To modify text placement on path, I would suggest adding a GUI handle, which you can manipulate from within the text tool (avoid switching tools). If you are hovering close to such a handle, the cursor should change to relect you are no longer editing text.

Cursor changes could also be used to denote creating a text on path, on a vector shape or blank (with a + icon).

Dockers

The only thing I would add is that you could expose character and paragraph settings in dedicated dockers. For styles, Adobe has a paragraph style and character style docker, whereas Affinity merges them. I prefer to have a dedicated docker for each style, so you have to do less scrolling.

Shortcuts

Another thing I like from Indesign is that it allows you to use the command search to change text (box) properties. The way is see it work in Krita is that if you have a text frame selected, it applies a property (e.g. italics or a character/ paragraph style) and if you have a specific piece of text selected, it would modify only that portion of the text. Text properties shouldn’t be sesrcheable if you don’t have a text related selection.

As for applying styles/ modifying text parameters, it woukd be good if it will be treated as a dedicated shortcut environment. That way, you can use easily accessible and memorisable shortcuts without them conflicting with existing shortcuts.

Quick manipulation pop-up GUI
Small quality of life improvement, if you have text selected, expose a pop-up GUI helper on canvas so you can easily click on B for bold i for italics, change font size, etc. You may know this from Microsoft Word.

Sorry, didn’t quote, typing on mobile :sweat_smile:

2 Likes

Thanks, I’ve added it to the notes!

You mean Photoshop here, right? Because inDesign seems to have them in one scrollable list from what I can see.

I haven’t used Word in like… 10 years, but I think I know what you mean :slight_smile:

Noteworthy dude <3

1 Like

No Indesign. Let’s just say I prefer them split :wink:

1 Like

Hey everyone, so I’ve updated the OP, and now got a general idea of where to go with the text tool.

One thing that has been really revelatory about this thread is that there’s two kinds of text tool: One for typing and editing text, and one for making text look pretty, and that most graphics programs provide the latter. This makies sense because a lot of artists copy text in from a brief. Our aim to support (indie) comic artists, as well as the feedback in this thread indicate that we’ve got more of an interest in the other usecase of just typing and editing text without any interference. For this reason, I’m going to make the text tool have two modes: A text editing mode and a type setting mode.

The text editing mode is our priority, this will function as a rich text editor, which means you can type, edit, copy, paste and format text. This will also include editing the wrapping area.

Type setting mode on the other hand will focus on on-canvas editing of things like spacing and giving more typesetting info like baselines and other metrics.

By making this split I hope to avoid a situation where someone helpfully tries to add widgets to edit the glyph positions that interfere with typing, or the opposite, implements a spell checking mode, which would be helpful for text editing, but would just give ugly underlines in type setting mode.

That said, the plan is as follows:

  1. I will now continue on with 5.2 docs, release notes and bugfixes.

  2. Once 5.2 is out, I’ll start working on Phase 1, which will cover all on-canvas interaction. This includes typing (including the use of input methods), copy, paste, undo. It also includes creating text with a font fqamily, size and whether it is horizontal, vertical, left to right or right to left. The thread converged on how the creation should work, and I’m fairly confident I’ll be able to make the text tool distinguish on whether you’re trying to create a text on path, text in shape, simple wrapped text or preformatted text.

  3. Phase 2 will be all about formatting the text. This will require a rewrite of the underlying code (I had previously not touched this code, only the text layout code) to solve some bugs with the way Krita stores data, and to ensure it will be simpler to manipulate the data with widgets.

    After that I’ll have to work on all the widgets themselves. We’re still trying to decide between a system that shows all properties in collapsible groups, or a system that only shows the active properties and allows you to add as necessary. In both cases, because there are 50+ properties, we’ll add a search box to find the relevant property, as well as a preset system to store any formatting.

    I wish I could’ve told you already whether we’re going with a docker, or a context menu or a floating menu, but I need to finish Phase 1 first. In particular, I need to finish Input Method support (which covers not just CJK input, but also things like the onscreen keyboard for android and the diacritics selection windows on MacOS), as I need to make sure that which ever we choose does not interfere with that.

  4. After all this, the text tool should be fully functional, and I’ll start Phase 3, where we’re going to work on conveniences like the type setting mode as well as things like the ability to show formatting marks (these are usually use for spaces and line breaks, but there’s also other unicode things like zero-width-joiner we could provide an icon for).

I hope to have phases 1 and 2 in 5.3, but overall I feel confident that the ordering of things will give a sense of progress despite me doing boring code stuff in the middle.

If you have any questions, feel free to ask.

19 Likes

You’re a hero!
This said, I do have a question: when you say formatting text, what do you mean exactly? To me formatting is basically everything you do that goes beyond editing the actual words and letters of the text. I.e. changing fonts, weights, styles, kerning, line spacing, colour, alignment, paragraph spacing, etc.
SO I’m curious: how are you planning to separate the two modes you are talking about?

2 Likes

Basically, in the regular text-editing mode, you can edit all of that, but only via the sliders and dropdowns in a docker (or wherever these sliders go), like all other rich text editors do.

In the typesetting mode, there will be on-canvas nodes and stuff you can move around to for example set the baseline-shift or to space characters (there will probably be more thing you’ll be able to adjust on-canvas, but I still need to pin down which elements). I’m also thinking of, instead of drawing the whole selection, typesetting mode will show the font metrics (x-height, line-height, etc). This is also why it will be a separate mode, so that we can make sure you can rely on the text editing mode having none of that when all you wanna do is type text (like you would in other text editors like Word).

The presets will be available for both modes.

EDIT: To clarify, I think you will still be able to edit text in typesetting mode, and perhaps the difference between the two will be minimal, but the reason I’m planning two separate modes is to ensure one use case will not interfere with the other. If your main concern is to type and edit text (for example, speech bubbles and caption boxes), text-editing mode will specialize in that. If your main concern is to align glyphs precisely (Logos, titles, other big texts), type setting mode will give you extra tools for that.

7 Likes

In typesetting mode you will be able to tweak the spacing between the letters and words, line height etc on canvas with grab handles, I think I saw a mockup somewhere showing this.

In regular edit mode you basically type text as in the word processor

2 Likes

Thanks a lot @wolthera @raghukamath !

Not having stuff get in the way is really great!
I can’t really think of a use case where I would need any setting not to be in a docker. with only the text, bounding box and optionally the text selection being rendered on the canvas.

2 Likes

@Papernoise see the mock shared by @Deevad few posts above. I think that shows how the type setting mode is probably going to be.

3 Likes

Hey everyone,

A small update on the text tool. I’ve been joined by Alvin Wong in working on the text code. We’ve managed to squash a ton of bugs together (as you may have noticed for beta 2), and Alvin implemented synthetic bold and italic (which is more or less required for CJK, as these fonts are so large they rarely have italic and bold versions available), as well as some initial work for on-canvas editing of wrapped text. I too have started work on on-canvas editing of text, with me managing to get a small demo up and running:

I’ll be working on this code here, and hopefully I won’t have too much trouble as we work through this first phase of getting all on-canvas interaction working.

23 Likes

:face_holding_back_tears: :face_holding_back_tears: :sob: I didnt know seeing a tool getting develop is going to make me teary.

I wish i have time to test it - if only i dont need to travel for work tomorrow.

Thank you, always , for your hardwork Wolthera and the team.
Looking forward for its development.

8 Likes

Huge thanks for the update!!!
It’s coming along really nicely!

4 Likes

I’m sure it’s been said but the text editing tool for Krita is not the strongest UX. I really want to switch to using Krita full time for all my graphic design and illustration needs but the text tool has a huge amount of friction.

Instead of using Krita I’m going to be resorting to using Canva. Which I really think Krita devs should check out. It’s not just photoshop, it does some stuff uniquely well. I think adopting their paradigm would be better. Photoshop feels old fashioned in comparison.

@jcklpe Not only said but actively being worked on. If you read this thread you will see what is in the works, who is working on it, and the kind of feedback that is helping.

Your comment has been added to the thread.

2 Likes

Finally able to build the branch.

And I say despite some stutter and still yet to be implemented on cursor feature.

The ability alone to edit on canvas is already easier than in the popup box. I can easily change color without closing the box back and forth just to see if it matches the background.

Performance is also better than years ago when krita has the old wonky on canvas editor. That one always crash krita.

Thank you again for the hard work. I’ll keep an eye on the branch.

7 Likes