Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-123817

QSvgRenderer renders text as path and not text

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6.2
    • SVG Support
    • None

    Description

      When rendering an SVG with text, the text is converted/render to/as a path and not as text.

      #include <QCoreApplication>
      
      #include <QObject>
      #include <QSvgGenerator>
      #include <QPainter>
      #include <QPdfWriter>
      #include <QSvgRenderer>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          QPdfWriter pdfWriter("out.pdf");
      
          pdfWriter.setPageMargins(QMarginsF(0, 0, 0, 0));
          pdfWriter.setPageSize(QPageSize(QSizeF(297, 210), QPageSize::Millimeter));
          // pdfWriter.setResolution(m_resolutionDPI);
      
          QPainter painter(&pdfWriter);
      
          QSvgRenderer svgRendere(QString::fromLatin1("in.svg"));
      
      
          svgRendere.render(&painter);
      
          painter.end();
      
          return a.exec();
      }
      

      Attachments

        1. in.svg
          15 kB
        2. out.pdf
          9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hatemelkharashy Hatem ElKharashy
            tobiasfalk tobias falk
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes