Ferdinand Ramirez | 8 Feb 22:10
Picon
Favicon

Script to grab outline and create svg files?

I am new to inkscape and would like to know if it is possible to automate the following process to create svg
files (I have manually succeeded in it), and if so, what does the script look like and how should it be executed?

In the manual process, I perform the following steps to create the svg file.

1) Open inkscape
2) Open File->Document Properties and set size to 1000 x 1000
3) Type t
4) Drag a rectangle (this step and previous step are needed to activate the Append button used in Step 7) 
5) Click on Text -> Glyphs
6) Choose Font family, script and range (this is not English, which is why I need this step)
7) Click characters and click append for each character clicked (more than one character is involved, and I
click on the character since I use an English keyboard but the language I am interested is not English)
8) Ctrl-Shift-C to grab the outline of the text
9) Save as svg by clicking File->Save As

I need to automate this process to create a number of svg files, some of which are formed due to the outline of
multiple characters.

Thanks,
-Ferdinand

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Ferdinand Ramirez | 9 Feb 19:05
Picon
Favicon

Text to svg command?

This is related to the previous post I made.

Is there a way to convert from the command line, a string to an svg file containing the outline of the glyphs
that represent the string?

-Ferdinand

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Matt Hines | 9 Feb 19:12
Picon

Re: Text to svg command?

You might be able to do it via a python script

On Feb 9, 2012 1:06 PM, "Ferdinand Ramirez" <ramirez.ferdinand <at> yahoo.com> wrote:
This is related to the previous post I made.

Is there a way to convert from the command line, a string to an svg file containing the outline of the glyphs that represent the string?

-Ferdinand

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Inkscape-user mailing list
Inkscape-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/inkscape-user
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Inkscape-user mailing list
Inkscape-user@...
https://lists.sourceforge.net/lists/listinfo/inkscape-user
Máirín Duffy | 9 Feb 21:49
Favicon
Gravatar

Re: Text to svg command?

Hi Ferdinand,

On Thu, 2012-02-09 at 10:05 -0800, Ferdinand Ramirez wrote:
> This is related to the previous post I made.
> 
> Is there a way to convert from the command line, a string to an svg file containing the outline of the glyphs
that represent the string?

This should be possible but as Matt mentioned, it might take use of a
python script.

The general recipe I'd approach it with:

- Create an SVG with some sample text in it, using the font / font
size / canvas size you're interested in
- Give the sample text a recongizable ID... e.g., "mytext"
- Save the sample SVG
- Write a python script using one of the available XML libraries in
python to open up the SVG, look up item with ID "mytext", and replace
the string in that item with whatever string you want in there
- Write out the SVG
- Rinse and repeat until you have a series of SVGs that have the strings
in them that you want
- Run command-line inkscape with the -T or --export-text-to-path option
on all of the SVGs to get the glyph outlines

This is just what I would think to do. It might not be the best possible
way but it should work. I've done similar python scripts before, using
the XML DOM to look up a specific element and replacing the string (we
use this process to translate graphical banners in Fedora.) I've not
relied on the -T / --export-text-to-path option on the command line
before but have no reason to suspect it wouldn't work the way you're
looking for it to.

Good luck,
~m

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Ferdinand Ramirez | 10 Feb 04:18
Picon
Favicon

Re: Text to svg command?

Thanks! If the last step works, this is exactly what I need. 

The --export-text-to-path option did not work, and on googling, I see that there was a request to make it
work with svg as well. https://bugs.launchpad.net/inkscape/+bug/903772

The last comment on that page is dated Jan 30 and I guess I need to upgrade to version 0.49 to make it work with
svg output.

-Ferdinand

--- On Thu, 2/9/12, Máirín Duffy <duffy@...> wrote:

> From: Máirín Duffy <duffy@...>
> Subject: Re: [Inkscape-user] Text to svg command?
> To: "Inkscape User Community" <inkscape-user@...>
> Date: Thursday, February 9, 2012, 12:49 PM
> Hi Ferdinand,
> 
> On Thu, 2012-02-09 at 10:05 -0800, Ferdinand Ramirez wrote:
> > This is related to the previous post I made.
> > 
> > Is there a way to convert from the command line, a
> string to an svg file containing the outline of the glyphs
> that represent the string?
> 
> This should be possible but as Matt mentioned, it might take
> use of a
> python script.
> 
> The general recipe I'd approach it with:
> 
> - Create an SVG with some sample text in it, using the font
> / font
> size / canvas size you're interested in
> - Give the sample text a recongizable ID... e.g., "mytext"
> - Save the sample SVG
> - Write a python script using one of the available XML
> libraries in
> python to open up the SVG, look up item with ID "mytext",
> and replace
> the string in that item with whatever string you want in
> there
> - Write out the SVG
> - Rinse and repeat until you have a series of SVGs that have
> the strings
> in them that you want
> - Run command-line inkscape with the -T or
> --export-text-to-path option
> on all of the SVGs to get the glyph outlines
> 
> This is just what I would think to do. It might not be the
> best possible
> way but it should work. I've done similar python scripts
> before, using
> the XML DOM to look up a specific element and replacing the
> string (we
> use this process to translate graphical banners in Fedora.)
> I've not
> relied on the -T / --export-text-to-path option on the
> command line
> before but have no reason to suspect it wouldn't work the
> way you're
> looking for it to.
> 
> Good luck,
> ~m
> 
> 
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity
> Planning
> Cloud computing makes use of virtualization - but cloud
> computing 
> also focuses on allowing computing to be delivered as a
> service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Inkscape-user mailing list
> Inkscape-user@...
> https://lists.sourceforge.net/lists/listinfo/inkscape-user
> 

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/

Gmane