Does anyone have examples of how to output in SVG format? I did a search on the boards and didn't get anything to return.
My output contest numbers.
I'd like to write string of numbers, like 1,2,3 on a middle of page.
Does anyone have examples of how to output in SVG format? I did a search on the boards and didn't get anything to return.
My output contest numbers.
I'd like to write string of numbers, like 1,2,3 on a middle of page.
As said in comment, just output the svg code you need in some I/O stream:
int main()
{
int a = 5;
std::cout << "<svg xmlns=\"http://www.w3.org/2000/svg\" width='100' height='100'>\n";
std::cout << "<text x='10' y='20'>" << a << "</text>\n";
std::cout << "</svg>\n";
}
Then compile:
$ g++ a.cpp
and run:
$ a.out > myfile.svg