sammycage / lunasvg

SVG rendering and manipulation library in C++
MIT License
866 stars 124 forks source link

render TEXT element #8

Closed spger closed 4 years ago

spger commented 4 years ago

Hi, I would like to know if is possible read and render Text element from svg file

sammycage commented 4 years ago

Text elements are not implemented.

sammycage commented 4 years ago

Currently working on it. It might take time.

spger commented 4 years ago

Okay, good to know. Thank you

sammycage commented 4 years ago

Added : https://github.com/sammycage/lunasvg/commit/785c5b4cf85882b24e470b33f7b550ca6f7b5bb3

#include <lunasvg/svgdocument.h>

using namespace lunasvg;

int main()
{
    SVGDocument document;
    document.loadFontFromFile("yourfavorite.ttf");
    document.loadFromFile("filewithtext.svg");

    Bitmap bitmap = document.renderToBitmap();

    // do something useful with the bitmap.

    return 0;
}
sammycage commented 4 years ago

Thank you for reporting this issue.