Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Printing Problem with the Helvetica Font [Qt 5.5.1]
Forum Updated to NodeBB v4.3 + New Features

Printing Problem with the Helvetica Font [Qt 5.5.1]

Scheduled Pinned Locked Moved Unsolved General and Desktop
helveticaprintinggarbledprint problemgarbled text
7 Posts 2 Posters 3.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Phil_W
    wrote on 29 Dec 2016, 23:05 last edited by Phil_W
    #1

    We are seeing that rich text having the Helvetica font prints out GARBLED using Qt 5.5.1 on Windows 7 and Windows 8.1. We were not seeing this problem with Qt 4.8.5.

    We are seeing this with the QTextEdit widget (using QTextEdit::print()) and with text features in a Qwt 6.1.3 plot.

    See the following three images, demonstrating use of many fonts.

    (1) View of rich text in a QTextEdit widget.
    (2) Screenshot of printed PDF file. (Direct printing to a physical printer shows the same results).
    (3) Qt font dialog showing that Helvetica is an available font. (Interestingly, "Helvetica Neue" is not).

    Rich Text Editor
    Garbled Text Printout
    Print Dialog

    It's not easy for us to just avoid Helvetica because many of our users' data files (from our program) specify the Helvetica font.

    Questions:
    (1) Any idea of what's going on here?
    (2) Is there a way to check for the (relevant-) validity of a font at run time? (I'm not seeing any such methods).

    Thank you in advance.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 29 Dec 2016, 23:08 last edited by
      #2

      Hi,

      IIRC, you can query QFontDatabase.

      Can you test with a more recent version of Qt if this is still happening ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Phil_W
        wrote on 29 Dec 2016, 23:54 last edited by
        #3

        [SGaist, thanks. Negatory on a newer version of Qt. Building Qt with WebEngine is not something we've been able to do. We tried a lot. We're just recovering from our port from Qt4, which took literally years].

        This may be a red herring -- I don't want to detract from the general problem -- but I am seeing our Qt 5.5.1, a qtbase/lib/fonts directory with twenty-four (24) helvetica_*_.qpf (QPF) files. (And not a lot of references to other fonts; that directory has 82 files altogether). I did try copying that directory in what seemed to be the correct place, relative to our application executable -- they didn't seem to be picked up (or at least, it didn't make a difference). THE "README" file in that fonts directory says that "QPF is the portable, endian-independent format used by Qt/Embedded 2.x and 3.x." -- so that doesn't even seem relevant for our Qt 5.5.1 widget-based desktop application. Does anyone know if these QPF files really could be relevant for that? And, if so, what we need to do to have our application pick them up?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 Dec 2016, 21:57 last edited by
          #4

          Just to be sure I understand you correctly, are you building Qt yourself ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          P 1 Reply Last reply 3 Jan 2017, 10:28
          0
          • S SGaist
            30 Dec 2016, 21:57

            Just to be sure I understand you correctly, are you building Qt yourself ?

            P Offline
            P Offline
            Phil_W
            wrote on 3 Jan 2017, 10:28 last edited by
            #5

            @SGaist ... yes, we are. It's true that I did struggle with, and didn't succeed in a successful build of Qt 5.6 with Web Engine. But I have to admit that most of that "literally years" I referred to was porting our humongous application. We were still depending on the Qt3 compatibility library for myriad legacy pieces. We are using Web Kit ... including its HTML DOM API, which is not available in Web Engine (as the HTML document doesn't even live in the application process), so that's going to be something. (Of course, Web Kit is gone in Qt 5.6 ... and I did struggle a bit trying to build that as a separate library, but didn't get through that either). (I'm a bit out of my element with that sort of thing). We're on Windows, Visual Studio 2010, with commercial Qt licenses. Maybe we don't need to be building Qt at all -- I'm not sure (memory model issues and such may be just fine with the binary distributions). I guess it's a future-security issue for us -- being able to build Qt from source.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 3 Jan 2017, 19:15 last edited by
              #6

              If you would like to stay with QtWebkit, there's @Konstantin-Tokarev reboot that might interest you.

              Note that you don't have to build all of Qt yourself to build one module.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Phil_W
                wrote on 10 Apr 2017, 23:04 last edited by
                #7

                Well this problem with garbled Helvetica in printed output (see images in prior post) is fixed if we DISABLE font embedding ... with this:

                • void QPrinter::setFontEmbeddingEnabled(bool enable)

                Two questions:

                (1) Does that given any insight into the problem we are having? (This is with Qt 5.5.1).
                (2) How reasonable is it to DISABLE font embedding? Will that cause any problems for our users?

                Thanks in advance.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved