1

Any ideas how to save a string with any font as an svg image?

I mean we can write a string to an image and save it, something like this:

Bitmap bitmap = new Bitmap(1, 1);
Graphics graphics = Graphics.FromImage(bitmap);
//..
graphics.DrawString(myString, myFont, /*...*/);
bitmap.Save(@"somewhere");

Can I save a string with a font as svg image too?

casperOne
  • 73,706
  • 19
  • 184
  • 253
sabisabi
  • 1,501
  • 5
  • 22
  • 40
  • Try this http://stackoverflow.com/questions/1525421/drawing-svg-in-net-c – Panagiotis Kanavos Nov 02 '12 at 15:16
  • @PanagiotisKanavos I saw this, I was just a little bit scared, because the last update was in year 2003 - thats why I thought maybe there are better or easier solutions for this issue. Maybe .net 4.0 is able to handle stuff like this without any lib? Do somebody know more about svg and .net? – sabisabi Nov 02 '12 at 15:31
  • 2
    You missed the point. SVG is a vector format stored in an XML file. It is not a bitmap. You could even create the xml through code like any other xml or HTML file. Check the text element's reference in MSDN to see how easy it is http://msdn.microsoft.com/en-us/library/ff972126(v=vs.85).aspx – Panagiotis Kanavos Nov 02 '12 at 15:39

0 Answers0