Font cut off when I convert from SVG to PNG

Post questions on how to use or achieve an effect in Inkscape.
johanndm
Posts: 7
Joined: Wed Mar 04, 2015 11:39 pm

Font cut off when I convert from SVG to PNG

Postby johanndm » Wed Mar 04, 2015 11:56 pm

I'm exporting a svg file with only text to png and some characters are being chopped off??

From the command line I do "inkscape -z -f 'sample-text.svg' -w 2770 -h 1180 -e 'sample-text.png'

I've tried to increase image size etc but it does this with quite a few of the font's I'm using?

Any suggestions?

Thanks
Attachments
sample-text.png
sample-text.png (149.7 KiB) Viewed 5445 times
sample-text.svg
(472 Bytes) Downloaded 209 times

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Font cut off when I convert from SVG to PNG

Postby ragstian » Thu Mar 05, 2015 12:03 am

Hi.

Convert the text to paths in Inkscape.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

johanndm
Posts: 7
Joined: Wed Mar 04, 2015 11:39 pm

Re: Font cut off when I convert from SVG to PNG

Postby johanndm » Thu Mar 05, 2015 12:15 am

Text is already a path - check the attached svg file. Also we use command line in batch mode?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Font cut off when I convert from SVG to PNG

Postby Lazur » Thu Mar 05, 2015 12:52 am

The text is on a path, but not converted to path in the sample svg.
(I don't have the great vibes font used in the test.)

Ctrl+Shift+C on screen to convert object to path -oh wait, have no idea about command line call for that, maybe it's not even possible.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Font cut off when I convert from SVG to PNG

Postby ragstian » Thu Mar 05, 2015 12:57 am

Hi.
Text is already a path - check the attached svg file. Also we use command line in batch mode?

Interesting, when I open the attached SVG file the text is not a path, but its ON a path
Select the text and inspect the object properties ( Shift Ctrl O ) to see.
Rotated text is always problematic in Inkscape as the kerning is not adjusted as it's rotated.
Insert a space at the end of the text to avoid the "clipping".
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

johanndm
Posts: 7
Joined: Wed Mar 04, 2015 11:39 pm

Re: Font cut off when I convert from SVG to PNG

Postby johanndm » Thu Mar 05, 2015 1:19 am

Just tried the "text-to-path" but doesn't seem to do the trick, I suspect it's the arc'd path that causes it. I followed these steps:

inkscape jm2.svg --export-plain-svg=jm2b.svg --export-text-to-path

when I look at jm2b.svg the text is still plain text??

I don't have the GUI so cannot test if it does the same there??

Here's a copy of the file : http://95.168.192.183/jm2.svg

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Font cut off when I convert from SVG to PNG

Postby hulf2012 » Thu Mar 05, 2015 2:04 am

Hello
I haven't see the file, because I'm pretty sure that I don't have the font

Here is a list of the verbs that Inkscape use in command line (I think it's not the last version):
http://how-to.wikia.com/wiki/How_to_use ... t_of_verbs

The verb you have to use is this:

Code: Select all

ObjectToPath: Convert selected object to path


Object to path command:
http://tavmjong.free.fr/INKSCAPE/MANUAL ... om-Objects

Just in case, About verbs:
http://tavmjong.free.fr/INKSCAPE/MANUAL ... dLine.html

By the way, what operative system are you using for?... and which version of Inkscape ??
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

johanndm
Posts: 7
Joined: Wed Mar 04, 2015 11:39 pm

Re: Font cut off when I convert from SVG to PNG

Postby johanndm » Thu Mar 05, 2015 2:16 am

I'm using Debian 3.2.60-1+deb7u3 and Inkscape 0.48.3.1 r9886 (Dec 29 2012)

Janne
Posts: 228
Joined: Wed Oct 29, 2014 4:15 am

Re: Font cut off when I convert from SVG to PNG

Postby Janne » Thu Mar 05, 2015 2:56 am

If the text was converted to path it would not matter that I don't have the font that's been used.

What is the dot in the upper left corner?
Outline mode shows exactly the same...

johanndm
Posts: 7
Joined: Wed Mar 04, 2015 11:39 pm

Re: Font cut off when I convert from SVG to PNG

Postby johanndm » Thu Mar 05, 2015 3:35 am


hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Font cut off when I convert from SVG to PNG

Postby hulf2012 » Thu Mar 05, 2015 4:29 am

johanndm wrote:great vibes: http://www.fontsquirrel.com/fonts/great-vibes (it's free)


great ...But ...Do you managed to convert the text to paths with "Object to paths command", or using the GUI < but you don't have gui? >?

also:
-z, --without-gui

Do not use X server. Doesn't seem to play well with --verb.


Try with the text converted to paths first. The letters are converted to groups, but that shouldn't matter when exported to png.

Maybe installing the last inkscape 0.91, the result could be different... mmm but there is for ubuntu ppa... i don't know if debian can use that system
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Font cut off when I convert from SVG to PNG

Postby tylerdurden » Thu Mar 05, 2015 4:38 am

Janne wrote:What is the dot in the upper left corner?

That dot is the text anchor.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

johanndm
Posts: 7
Joined: Wed Mar 04, 2015 11:39 pm

Re: Font cut off when I convert from SVG to PNG

Postby johanndm » Thu Mar 05, 2015 5:16 am

Ok I have managed to get a work around for this.

First step is exporting to PDF using:
inkscape -z -f sample-text.svg --export-text-to-path --export-pdf=sample-text..pdf

This converts the text to paths - it seems --export-text-to-path only works for PDF, PS and EPS

Then I convert the PDF to PNG and use it in the rest of the composite image build we need.

Hopefully this is fixed in inkscape 0.91 :-)

Thanks for all the suggestions and pointers!

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Font cut off when I convert from SVG to PNG

Postby hulf2012 » Sun Mar 08, 2015 2:26 am

johanndm wrote:Ok I have managed to get a work around for this.

First step is exporting to PDF using:
inkscape -z -f sample-text.svg --export-text-to-path --export-pdf=sample-text..pdf

This converts the text to paths - it seems --export-text-to-path only works for PDF, PS and EPS

Then I convert the PDF to PNG and use it in the rest of the composite image build we need.

Hopefully this is fixed in inkscape 0.91 :-)

Thanks for all the suggestions and pointers!


Glad you solve your problem, but...

Did you eeeever try converting the text to paths with the ObjectToPath command (or shift+ Ctrl + C, with the GUI????) :x :evil:

Honestly, from user to user, Your solution doesn't seem ... "elegant"... but it's Ok, it's ok... "no importa que el gato sea blanco o sea negro, lo importante es que caze ratones"...

Greetings
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

johanndm
Posts: 7
Joined: Wed Mar 04, 2015 11:39 pm

Re: Font cut off when I convert from SVG to PNG

Postby johanndm » Tue Mar 31, 2015 7:43 pm

We use 100% command line - so cannot tell if the GUI part works. We use Inkscape on a backend server to a web (html/javascript) product designer to merge and convert various parts of the design.


Return to “Help with using Inkscape”