Нi evеryone I am trying to render my svg file(i get it from osm ). I've this code:
#include <QSvgRenderer>
#include <QPainter>
#include <QImage>
#include <QDebug>
.............................
QSvgRenderer renderer(QString("map(8).svg"));
QImage image(1920, 1080, QImage::Format_ARGB32);
image.fill(0xaaA08080);
QPainter painter(&image);
renderer.render(&painter);
image.save("./map.png");
this compile and works, but my svg file do not have any characters. and i get this
Qt says some warnings:
qt.svg: link glyph0-1 hasn't been detected!
qt.svg: link glyph1-1 hasn't been detected!
but if i'v open vsg in vs code i see these links, it's look like this:
<g style="fill:rgb(13.333333%,13.333333%,13.333333%);fill-opacity:1;">
<use transform="rotate(270, 11.911424, 25.427054 )" xlink:href="#glyph2-12" x="11.911424" y="25.427054"/>
</g>
And of course all browsers (Firefox, Chrome) render this svg fine with all words. I have no idea what's happen. My svg header
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="377pt" height="230pt" viewBox="0 0 377 230" version="1.2">
Help please
Aucun commentaire:
Enregistrer un commentaire