Inkscape Community

Help Using Inkscape => Beyond the Basics => Topic started by: pranavcp on July 13, 2016, 02:58:01 AM

Title: Convert SVG to PNG with Underline
Post by: pranavcp on July 13, 2016, 02:58:01 AM
Hi,
I am using CentOS6 with Inkscape 0.49 on it as latest version is not avail for that but for ubuntu only. I am converting SVG to PNG with command

inkcape -z product_1.svg -e product_1.png

which gives me perfect output but not for the underlined texts.

Any solutions for the same, as It is very important feature and want to implement the same.
Title: Re: Convert SVG to PNG with Underline
Post by: brynn on July 13, 2016, 03:25:10 PM
Welcome to Inkscape Community!

It sounds like you're using the command line, and I'm not very familiar with that.  The Inkscape Text tool doesn't provide for underlines (although it seems like I've seen that will be available in the next few new versions).  So if you want to have underlined text, you have to actually draw them yourself, using Pen or Pencil tool.

But somehow, it looks like you've been able to make underlines!  Did you paste the text in, which was created somewhere else?  Or did you use the command line to create it? 

When I use File menu > Export PNG, it exports the underline.  So I'm not sure if it's a deficiency with the command line?  Although, I did edit the file a bit, before I made that export.  Let me try without changing anything....  Hm, no, the underlines came through perfectly!

Let me ask, do you know if the command you used accesses the same function that Export PNG provides?  It must be somehow different.  Would you be able to use the Export PNG dialog, rather than the command?

Edit
Or maybe it's something about what you're viewing the PNG with?  Because look at the attachment below.  It shows the underline.  But if you click on it, which will bring it up to full size (in a new window), the underline isn't showing!
Title: Re: Convert SVG to PNG with Underline
Post by: ugajin on July 14, 2016, 04:25:01 AM
Using the XML editor (v0.91), add a style attribute to the 'tspan' element (not the text element), with the value 'test-decoration: underline'.

- u
Title: Re: Convert SVG to PNG with Underline
Post by: brynn on July 14, 2016, 04:17:56 PM
Welcome ugajin!

You're saying that by using the XML Editor, it's possible to create underlined text?  If underlining isn't added to the Text tool pretty soon, I'll probably be using that!  I haven't written any tutorials lately, but that will be very handy.
Title: Re: Convert SVG to PNG with Underline
Post by: ugajin on July 15, 2016, 04:13:39 AM
Yes; none, underline, overline, and strikethrough, seem to work with the XML Editor in Inkscape v0.91. You can also paint (stroke & fill) text a different colour to the decoration,. Sadly, Inkscape omits the decoration when converting Object to Path, at lest it does on OS X.

-u
Title: Re: Convert SVG to PNG with Underline
Post by: brynn on July 16, 2016, 01:49:59 AM
Hey, I just came across an extension for underlining text!

I haven't tried it yet, but here's the link:  https://github.com/mcjohnalds/inkscape-underlinetext

Just fyi....is a little bit off topic, but can't hurt to have related info in one place :)
Title: Re: Convert SVG to PNG with Underline
Post by: ugajin on July 16, 2016, 03:37:43 AM
s/at lest it/at least it/.

This may also be off topic: https://bugs.launchpad.net/inkscape/+bug/1269206 (https://bugs.launchpad.net/inkscape/+bug/1269206).