Fri 02 Jan 2015 04:27:39 PM UTC, comment #7:
I was using inkscape, and there you have a zero baseline-shift as default when entering new text. That translates to the bottom verticalalignment of your example, so I guess that got me confused.
|
Fri 02 Jan 2015 01:37:38 PM UTC, comment #6:
consider the following Octave code:
which produces following SVG (snipped header and footer)
As you can see the y position of the line and the text are always the same and "baseline-shift = font-size/2" is used to vertically center the text, 0 for bottom and font-size for top.
I also attach the exported PNG from inkscape. I still can't see an error in Octave, gl2ps and Inkscape
(file #32748)
|
Fri 02 Jan 2015 10:55:06 AM UTC, comment #5:
but the line
from foo.svg shows that the text itself ('ZZZ') gets shifted, not only the labels. Why is normal text shifted?
|
Fri 02 Jan 2015 02:26:18 AM UTC, comment #4:
So it seems that gl2ps is producing valid svg and that there is notihng Octave should do per se.
Workarounds exist such as using a fully svg-compliant viewer like Inkscape or translating to svg through a different format like postscript or pdf.
Closing report.
|
Thu 01 Jan 2015 09:45:49 PM UTC, comment #3:
The SVG attribute in question is "baseline-shift" http://www.w3.org/TR/SVG11/text.html#BaselineShiftProperty
The svg generated by gl2ps looks fine for me. It uses font-size="10" and baseline-shift="-10" to draw the xlabels which should show text below the box.
I've found a bugreport because baseline-shift isn't implemented in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=308338
I created a testimage
Only Inkscape renders correct here, LibreOffice, Gimp and Iceweasel fail
|
Mon 29 Dec 2014 05:46:07 PM UTC, comment #2:
This will be hard to fix since we rely on gl2ps to construct the svg from the OpenGL window. Really it needs to be fixed upstream, if it needs to be fixed.
I get quite acceptable results with Inkscape, bad results with Libreoffice or Firefox, and intermediate results with KDE's svg renderer. This is the same experience reported by Pantxo so I'm not sure who is following the svg standard and who is not. It may be that gl2ps is creating correct svg code.
As a workaround, I find working in Inkscape with svg to be quite easy. There is also the choice of exporting to a format like postscript or pdf and then importing that into svg through Inkscape or another program. I had good results doing that including being able to recognize text as text, rather than just graphic images.
|
Mon 15 Dec 2014 11:58:29 PM UTC, comment #1:
Hi,
Confirmed on linux mint 17.1. Note that only tick labels are shifted, not the text object (wich isn't necessary to reproduce the bug).
LibreOffice, Firefox, gThumb and Gimp all render shifted tick labels (not necessarily consistent between each other) while in Inkscape the shift is not obvious (if any).
|
Mon 15 Dec 2014 06:53:14 PM UTC, original submission:
Doing
results in the attached foo.svg. You will notice that all characters have gotten a baseline-shift, which is very inconvenient for subsequent editing.
|