subscript, superscript without selected text

Bug #657321 reported by helix84
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Medium
Unassigned

Bug Description

I just installed 0.48 on Windows and tried the new subscript/superscript. I don't think it works as one expects from word processors (and there's nothing in release docs about how it's supposed to work, so I assume it should work as in word processors).

It works correctly when you first write text, make a selection, then press subscript/superscript toolbar button - it makes the selection a subscript/superscript relative to the rest of the text.

It doesn't work correctly when you write text, then press press subscript/superscript toolbar button.
What's supposed to happen is that all text written afterwards will be subscripted/superscripted.
What actually happens is that the whole unselecte text becomes smaller (e.g. from Bitstream Vera Sans size 40 it becomes size 7.8) and the position is changed strangely. Also observe the position of text cursor relatively to text and then watch it when you try to type in more characters.

Tags: text ui
su_v (suv-lp)
tags: added: text ui
Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Windows XP, Inkscape 0.48.

When the text is selected, a style attribute is added to the svg:tspan element with the following items:
font-size:65%;baseline-shift:super

But when the text is not selected, the same items are added to the style attribute of the svg:text element, and there's no svg:tspan style attribute.

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Adam Doyle (adamdoyle) wrote :

At present, if you have "abcd" superscripted and you highlight just the "bc" and press superscript, then it takes the "bc" up to an even higher level (which is fine with me - sometimes that is necessary). If it's determined that it's necessary to keep that functionality, then a third button would be useful for bringing the text down to the original level. (you could call it "reset subscript/superscript" or something) There is currently no way to do that other than deleting everything that's superscripted and starting over.

Another undesired (or at least unexpected) behavior is that pressing superscript or subscript when there is nothing highlighted/selected results in superscripting/subscripting the whole svg:text element. This is useless. When would you ever need to do that? (the whole point of superscripting is to be able to do it WITHIN the text) A more useful action for that scenario would be to just move the cursor up to the superscripted/subscripted position so that you can start typing there. (e.g. I have "asdf" and my cursor is after the "f" and there is nothing highlighted. I press [superscript] and the cursor moves up so that I can type an exponent or whatever. This would be much more useful and expected.)

Revision history for this message
Adam Doyle (adamdoyle) wrote :

Also: the highlighting is little off on superscripted/subscripted text. Attached is an example of both the current and proposed behavior.

Revision history for this message
atenrok (atenrok) wrote :

I'd vote for #2. The behaviour one expects (simply because majority of advanced text processors do that) is that subscript/superscript button toggles the format of selected text. In current implementation there is no way to restore the formatting of subscripted/superscripted text except to erase all & retype.

The subscript/superscript button should also reflect the format of the particular character when it is highlighted, i.e. when the selected symbol is already been subscripted -- the corresponding button should turn its state to "pressed", so de-pressing the button would restore the default formatting.

Revision history for this message
Sponge Bob Square Pants (lumpy) wrote :

Inkscape 0.48.2 r9819@Windows XP Pro

Subscripts and superscripts do not render correctly.
1.Try making a textbox and combine regular letters / subscripts / superscripts (eg. chemical formula)
2. Save file and open it with Firefox and you'll see that all letters aligned to the bottom of the line! Not working!
3. Try uploading file with subscripts to WIKIMEDIA (http://commons.wikimedia.org/wiki/Special:UploadWizard) - sub- and superscripts become HUGE in size :) AWFUL BUG!

Revision history for this message
David Mathog (mathog) wrote :

Additionally super/sub scripts do not render correctly in either current Firefox or Seamonkey. (It could be a bug with those browsers?) In the attached example the upper line uses super/sub scripts, whereas the bottom line has the double cross character placed manually. In inkscape they look identical (or at least very, very close). In Seamonkey/Firefox not only do they not look alike, they are both screwed up! The top line has both super and sub as subscript, and the lower line has the double cross offset left too far.

This could be a bug in those browsers, so as a tie breaker, I tried opening it in LODraw 3.5.0rc1
That looked somewhat like the browsers, except double cross characters were even more offset leftwared
 on the lower line, and were (for some bizarre reason) grouped together at the end of the top line.

Anyway, I made a test case in LODraw and exported it as SVG. That one is viewed properly in Firefox. It looked more or less the same in Inkscape, although subscript was a little low.

 Will attach that next.

This was all on Windows with Trunk.

Revision history for this message
David Mathog (mathog) wrote :

This one has super and subscripts when viewed in Firefox and Seamonkey

Revision history for this message
David Mathog (mathog) wrote :

This is primarily, if not entirely, a Mozilla SVG rendering bug. Try this test page with Firefox or Seamonkey:

http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-text-align-02-b.html

Don't hold your breath waiting for a fix, the problem has been known since 2005!

https://bugzilla.mozilla.org/show_bug.cgi?id=308338

Revision history for this message
David Mathog (mathog) wrote :

Opera works better, the baseline-shift part works properly. But the manually positioned super/sub letters are still off.
A screen snapshot is attached.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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