-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read text from svg file #17
Comments
Rendering text requires font so you have to call |
Please clarify your question with an example! |
I will use your example with a little change:
Everything works great for me except the text. Maybe I need a particular font or all types of font should work? |
Please test whether this will fail. #include <lunasvg/svgdocument.h>
#include <iostream>
using namespace lunasvg;
int main()
{
SVGDocument document;
if(!document.loadFontFromFile("ARLRDBD.TTF"))
std::cout << "loadFontFromFile : Failed" << std::endl;
if(!document.loadFromData("<svg><text x='0' y='15' fill='red'>I love SVG Too!</text></svg>"))
std::cout << "loadFromData : Failed" << std::endl;
Bitmap bitmap = document.renderToBitmap();
// do something useful with the bitmap.
return 0;
}
|
It works! thanks. |
You're welcome :-) |
I have seen the previous issues about reading text from svg file. Can I get more detailed about it? Or another example of the improvement you made? If I use the loadfromdata() function, what kind of string can be inserted into the function for reading text from svg?I tried to use the text tag but it was not so successful.
The text was updated successfully, but these errors were encountered: