Setting Font size using combobox in Text toolbar broken

Bug #168397 reported by Bug Importer
18
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
bbyak

Bug Description

What I do:

Create Textbox;
Put in "Test";
CTRL+A;
Select all in the font-size drop-down menu;
Overwrite with 78;

What happens:

78 becomes 182

Same with 99 instead of 78 (becomes 192);...

Reach me via <email address hidden>

Revision history for this message
Amphi-users (amphi-users) wrote :

Originator: NO

The problem doesn't occur if one doesn't select all. The different glitchy
behaviour is sorta puzzling... btw that happens on win2k, too.

Well, it should be fixed since other graphic packages (eg Photoshop)
require that you select all before you change the size.

Revision history for this message
JiHO (jiho) wrote :

Originator: NO

I can confirm this, when you select some text and try to write a number in
the Font size spinbutton, the number already existing in the spin button is
not erased and the new number are added. If you try to use the delete key,
this actually deletes your text.
So there is a double bug with this spinbutton: Inkscape canvas still
listen to keyboard entries even when the spinbutton is selected _and_ the
text in the spinbutton is not manually modifiable.

Revision history for this message
nightrow (jb-benoit) wrote :

setting status to confirm to reflect last comment

Changed in inkscape:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Maximilian Albert (cilix) wrote :

I can't reproduce this behaviour with current SVN. I suspect it was fixed in the meantime, since there was some work on the text tool (e.g., during the Summer of Code project).

But when entering numbers manually in the entry field, it responds to every keystroke, which is very unconvenient and annoying. For example, enter 20, then delete the '0' --> text size jumps to 2; or if you accidentally enter another number (say, 3) it jumps to the huge size of 203. Instead, the entry field should only react when return is pressed.

Revision history for this message
BB (benkasminbullock) wrote :

Somebody sent me a message saying the above bug is a duplicate of the following one:

https://bugs.launchpad.net/inkscape/+bug/168917

Huh? They are completely different bugs.

Revision history for this message
Tom Davidson (tjd-mit) wrote :

No, it's still very broken (in latest svn rev 16978). Note you don't have to do anything tricky to reveal this bug, but the following steps may be helpful in isolating the problem:

1: create a really big text box containing 2 short words, like 'CAT DOG'
2: make sure that the box is big enough: select all and set the size to 500px using the font and text dialog (Ctrl-Shift-T). Okay, now set it back to 48px and close the text dialog.
-->The fontsize in the flowRoot and the flowPara are both now 48 according to the XML editor
3: highlight the word 'CAT', and change its size to 64 using the *drop down menu* from the tool bar (no typing yet)
-->The fontsize in the flowRoot is still 48, and a new flowSpan with size 64 is created--OK
4: with 'CAT' still selected highlight the '64' in the spinbox with your mouse and type '2' (as if you wanted to change the font size to 24)
-->The fontsize for the flowSpan changes to 248. I.e. the fontsize from the *flowroot* element, prepended with the digit you just typed.; the spinbox correctly shows '248'

It seems like after the '64' is deleted, but before the '2' can be recognized, Inkscape is replacing the value with the default value of '48' from the flowroot, and putting the cursor at the beginning of the field.

This is bad enough, but unfortunately it's compounded by another problem: if your textbox is not big enough to show a (for example) 248px font, then the font size is still changed to 248, but the spinbox text just updates to '48' with the cursor placed between the 4 and the 8. In addition, whatever text you have selected in the text box is deselected. This means that the next digit you type (say '4', in our example) now tries to set the font size to '428' and it applies to all the text (both 'CAT' and 'DOG', in our example), since we've lost the selection. Phew!

I'm not sure what the best solution is. Probably waiting for an 'enter', or for the box to otherwise lose focus, would go a long way towards this, since the problem seem to essentially be overzealous updating.

I found and labeled a few dupes of this bug--I think it's really visible, and seems to really confuse people... I'm sorry that I'm not in a position to fix it, but I think it's a good candidate for milestoning.

Changed in inkscape:
importance: Low → Medium
milestone: none → 0.46
Revision history for this message
Tom Davidson (tjd-mit) wrote :

Please also note that mashing on the keyboard in this case may trigger a freeze/crash if the requested font size ends up being bigger than a few thousand px, as detailed in the separate report at bug 169057

Revision history for this message
bbyak (buliabyak) wrote :

fixed in svn, rev 17194

please test

note that now, if you type in a new value, you need to press enter for it to take effect

Changed in inkscape:
assignee: mderezynski → buliabyak
status: Confirmed → Fix Released
Revision history for this message
Tom Davidson (tjd-mit) wrote :

This works great! One last issue is that when you leave the text box *without* pressing enter (e.g. by tabbing, or by clicking elsewhere), I think that the value in the text box should either be applied, or should revert to the old value.

1-create some text at 48px
2-type over the 48, with, e.g. 12, but don't press enter
3-tab or click away from the entry field

Result: The font size remains 48px, but the text box now reads 12.

If you disagree, then please mark fix-released, as the original bug is fixed for me...

Revision history for this message
Tom Davidson (tjd-mit) wrote :

Re-opening due to one last problem. If you delete the font size, then hit enter, the fontsize in the XML tree gets set to '', nothing, the empty string. Inkscape tries to render this but in so doing loses formatting information. I think a better solution would be for Inkscape to not allow the setting of a null fontsize, and just cancel the request. I believe this is related to the now-closed bug 168377.

1: new document, create some text (default size 40px)
2: set the alignment to 'center'
3: delete the font size in the font toolbar, and hit enter

Result: the text is rendered as 12px (reasonable), left aligned, even though the XML editor says that text-align is still 'center'

Changed in inkscape:
status: Fix Released → Confirmed
Revision history for this message
bbyak (buliabyak) wrote :

ok, fixed both problems in 17195: defocusing now sets the new size (except if you do it by Esc), and any non-numeric values typed in (including empty) are not set.

Changed in inkscape:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.