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

QTextLayout::draw() renders text as path and not text

XMLWordPrintable

    • 4d9bd9572 (dev), 09918e3da (6.10), 07b3434f9 (6.9), 8bdaa95e8 (tqtc/lts-6.8)

      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[])
      {
          QGuiApplication 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("simple.svg"));
      
      
          svgRendere.render(&painter);
      
          painter.end();
      
          return a.exec();
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            esabraha Eskil Abrahamsen Blomfeldt
            tobiasfalk tobias falk
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes