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

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

    XMLWordPrintable

Details

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

    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[])
      {
          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();
      }
      

      Attachments

        1. simple.svg
          0.4 kB
          Robert Löhning

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes