bugGNU Octave - Bugs: bug #43827, print svg with incorrect font...

 
 

bug #43827: print svg with incorrect font baseline

Submitted by:  Muhali <muhali>
Submitted on:  Mon 15 Dec 2014 06:53:14 PM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

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.

Muhali <muhali>
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)

Andreas Weber <andy1978>
Project Member
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?

Muhali <muhali>
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.

Rik <rik5>
Project Administrator
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

Andreas Weber <andy1978>
Project Member
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.

Rik <rik5>
Project Administrator
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).

Pantxo Diribarne <pantxo>
Project Member
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.

Muhali <muhali>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #32748:  out.png added by andy1978 (3KiB - image/png - exported png from inkscape)
file #32677:  foo.svg added by muhali (6KiB - image/svg+xml)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by muhali (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 02 Jan 2015 01:37:38 PM UTCandy1978Attached File-=>Added out.png, #32748
    Fri 02 Jan 2015 02:26:18 AM UTCrik5StatusConfirmed=>Wont Fix
      Open/ClosedOpen=>Closed
    Mon 15 Dec 2014 11:58:29 PM UTCpantxoStatusNone=>Confirmed
    Mon 15 Dec 2014 06:53:15 PM UTCmuhaliAttached File-=>Added foo.svg, #32677

    Back to the top


    Powered by Savane 3.1-cleanup1