Command Line Transform

Post questions on how to use or achieve an effect in Inkscape.
jleniger
Posts: 2
Joined: Thu Jun 19, 2014 1:49 am

Command Line Transform

Postby jleniger » Thu Jun 19, 2014 1:53 am

Hello,

I am struggling with what *should* be a simple task.

I needed to convert an SVG font (collection of "glyphs") to a regular SVG image readable by a browser or Inkscape. I managed to convert them by writing a program to create individual SVG files for each glyph, then writing a batch file to flip all of them vertically with Inkscape, because for some reason font SVGs have a different Y axis than normal SVG images.

The only issue now is that every single image extends beyond the top border of the canvas a bit, and the canvas is too large in the other directions.



Is there any way (ideally via command line, as there are about 150 images and batch scripts are far faster than me) to at minimum shift each image down, and ideally also size the canvas to the image?



Thanks!

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

Re: Command Line Transform

Postby ragstian » Thu Jun 19, 2014 6:01 am

Hi.

Svg files containing text should be possible to display directly in your browser or by Inkscape without converting each character.
(I have a feeling you are 'jumping over the stream to fetch the water' -
translated Norwegian proverb - meaning; you are making things more difficult than necessary.)

See the SVG specs for text handling; http://www.w3.org/TR/SVG/text.html
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

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

Re: Command Line Transform

Postby Lazur » Thu Jun 19, 2014 9:46 pm

Inkscape's coordinate system is flipped compared to the svg specifications.
Check a regular inkscape svg's structure, maybe the global transformation you can copy from it would solve the problem.

jleniger
Posts: 2
Joined: Thu Jun 19, 2014 1:49 am

Re: Command Line Transform

Postby jleniger » Fri Jun 20, 2014 12:12 am

Sorry, I should have been more clear. For whatever reason the SVG font will not display on the Smart TV app I am developing, but a regular SVG will display.

I already have extracted and inverted every image from the SVG font, that is not the issue. The main issue is they all extend a bit above the top border of the canvas, so they don't display correctly in an HTML document. I just need to center them and size the canvas to the object. There is already a menu item in Inkscape that does this and it works perfectly, it's just slow when you have hundreds of files to do this to so I was hoping for some automated way to do this.

Thanks!


Return to “Help with using Inkscape”