Closed floppyhammer closed 10 months ago
It will be very difficult to remove the renderer... You can use otfsvg which is designed specifically for this purpose.
Useful Links
Example : https://github.com/sammycage/otfsvg/blob/main/otfsvg-dump.c Issues : https://github.com/sammycage/otfsvg/issues
@sammycage thanks for your previous answer. I want to ask you the following.
In this example, the Document::loadFromFile
method is used as a parser for the input SVG file. Then, the document is rendered by calling document->renderToBitmap()
.
// Example in README
auto document = Document::loadFromFile("tiger.svg");
auto bitmap = document->renderToBitmap();
I am also interested in just parsing SVG files. I was assuming that Document::loadFromFile
only performs parsing. Is this wrong? Ideally, I'd like to have a function that only checks whether the input SVG file is valid.
Thanks in advance! Manuel
A similar question to this: my understanding of the codebase is that currently it is not possible to materialize Layout objects back to SVG?
since lunasvg doesn't allow accessing parsed model, I suggest to have a look at another lib for parsing svg: https://github.com/cppfw/svgdom
Is there any example showing how to use it for parsing, in case I want to do rendering myself?