Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Freetype font rendering on Windows?
Forum Updated to NodeBB v4.3 + New Features

Freetype font rendering on Windows?

Scheduled Pinned Locked Moved Installation and Deployment
20 Posts 7 Posters 16.4k 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
    peglegrot
    wrote on 23 Nov 2010, 20:17 last edited by
    #1

    Can Qt be built with Freetype support on Windows?
    There's subfolder in the bundled Freetype source that at least points in that direction:
    qt-source/src/3rdparty/freetype/builds/win32

    Thank you!

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on 23 Nov 2010, 20:53 last edited by
      #2

      Features can be switchen on by configure. But freetype can only be switched on for Symbian or Qt Embedded. So I'm afraid, freetype can't be switchen on for windows directly. You can try to call configure and then modify the pro / makefiles to inckude it, but I think, it is not tested...

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        peglegrot
        wrote on 24 Nov 2010, 14:37 last edited by
        #3

        [quote author="Gerolf Reinwardt" date="1290545596"]But freetype can only be switched on for Symbian or Qt Embedded.[/quote]
        Yes, that's what I had figured out, too.

        I'd love to hear a concluding statement by the Qt devs...

        1 Reply Last reply
        0
        • C Offline
          C Offline
          chantivlad
          wrote on 1 Feb 2011, 17:47 last edited by
          #4

          [quote author="peglegrot" date="1290609442"]I'd love to hear a concluding statement by the Qt devs...[/quote]

          Me too. No feedback yet ?

          1 Reply Last reply
          0
          • I Offline
            I Offline
            iamsergio
            wrote on 3 Nov 2014, 15:47 last edited by
            #5

            With Qt5, pass:
            -platform windows:fontengine=freetype

            to your app

            1 Reply Last reply
            0
            • C Offline
              C Offline
              culyun
              wrote on 18 Nov 2014, 01:38 last edited by
              #6

              Qt5 == yes
              Qt4 == no.. but read on

              ==============

              I've just finished patching the 4.8.6 source to support Freetype on Windows (including Windows CE). It seems to be working well, but has not been reviewed.

              1 Reply Last reply
              0
              • I Offline
                I Offline
                iamsergio
                wrote on 18 Nov 2014, 07:57 last edited by
                #7

                [quote author="culyun" date="1416274707"]Qt5 == yes
                Qt4 == no.. but read on

                ==============

                I've just finished patching the 4.8.6 source to support Freetype on Windows (including Windows CE). It seems to be working well, but has not been reviewed.[/quote]

                Got a link ?

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  culyun
                  wrote on 18 Nov 2014, 20:33 last edited by
                  #8

                  Too soon. it's just popped out of the oven so to say. That said, I can provide a patch file for 4.8.6. Give me a week or two and I'll publish the patch.

                  I'm going to commit the changes to Gerrit for the devs to mull over.

                  I'm going to upload to gerrit
                  [quote author="iamsergio" date="1416297451"]
                  [quote author="culyun" date="1416274707"]Qt5 == yes
                  Qt4 == no.. but read on

                  ==============

                  I've just finished patching the 4.8.6 source to support Freetype on Windows (including Windows CE). It seems to be working well, but has not been reviewed.[/quote]

                  Got a link ?

                  [/quote]

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    lunatic fringe
                    wrote on 20 Nov 2014, 23:54 last edited by
                    #9

                    How can i programmatically select the freetype engine on startup?
                    On the windows platform we have a (ttf) font looks good with a Qml App and ugly on a Widget App when not using the command line option to use the freetype font engine. This is still unclear to me.

                    Regards.

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      lunatic fringe
                      wrote on 20 Nov 2014, 23:54 last edited by
                      #10

                      How can i programmatically select the freetype engine on startup?
                      On the windows platform we have a (ttf) font looks good with a Qml App and ugly on a Widget App when not using the command line option to use the freetype font engine. This is still unclear to me.

                      Regards.

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        culyun
                        wrote on 21 Nov 2014, 01:37 last edited by
                        #11

                        I don't think you can specify at runtime, but it is an interesting idea...

                        But if you're willing to build Qt5 for yourself (not too hard) you can configure the build so that Freetype is used internally by Qt on Windows (widget apps).

                        [quote author="lunatic fringe" date="1416527650"]How can i programmatically select the freetype engine on startup?
                        On the windows platform we have a (ttf) font looks good with a Qml App and ugly on a Widget App when not using the command line option to use the freetype font engine. This is still unclear to me.

                        Regards.[/quote]

                        1 Reply Last reply
                        0
                        • C Offline
                          C Offline
                          culyun
                          wrote on 21 Nov 2014, 01:37 last edited by
                          #12

                          I don't think you can specify at runtime, but it is an interesting idea...

                          But if you're willing to build Qt5 for yourself (not too hard) you can configure the build so that Freetype is used internally by Qt on Windows (widget apps).

                          [quote author="lunatic fringe" date="1416527650"]How can i programmatically select the freetype engine on startup?
                          On the windows platform we have a (ttf) font looks good with a Qml App and ugly on a Widget App when not using the command line option to use the freetype font engine. This is still unclear to me.

                          Regards.[/quote]

                          1 Reply Last reply
                          0
                          • L Offline
                            L Offline
                            lunatic fringe
                            wrote on 21 Nov 2014, 23:21 last edited by
                            #13

                            At least you can manipulate the arguments for QApplication ...
                            But i have still difficulties using fonts under windows whether i use the freetype font engine or not.
                            We need to use a Bosch font, which looks like
                            qml app : !http://burningrain.no-ip.info/images/font_in_qml.png(qml app)!
                            widget app: !http://burningrain.no-ip.info/images/font_in_widget.png(widget app)!

                            Does anyone knows how to improove the presentation of the font in the qt app ?

                            1 Reply Last reply
                            0
                            • L Offline
                              L Offline
                              lunatic fringe
                              wrote on 21 Nov 2014, 23:21 last edited by
                              #14

                              At least you can manipulate the arguments for QApplication ...
                              But i have still difficulties using fonts under windows whether i use the freetype font engine or not.
                              We need to use a Bosch font, which looks like
                              qml app : !http://burningrain.no-ip.info/images/font_in_qml.png(qml app)!
                              widget app: !http://burningrain.no-ip.info/images/font_in_widget.png(widget app)!

                              Does anyone knows how to improove the presentation of the font in the qt app ?

                              1 Reply Last reply
                              0
                              • C Offline
                                C Offline
                                culyun
                                wrote on 3 Dec 2014, 22:45 last edited by
                                #15

                                I think all you need is a simple mod to the Qt 5 source.

                                In

                                .\qtbase\src\plugins\platforms\windows\qwindowsfontdatabase_ft.cpp

                                Goto addFontToDatabase

                                and modify the line that reads

                                const bool antialias = false;

                                to

                                const bool antialias = true;

                                Rebuild Qt, and voila anti-aliasing on Windows.

                                [quote author="lunatic fringe" date="1416612075"]At least you can manipulate the arguments for QApplication ...
                                But i have still difficulties using fonts under windows whether i use the freetype font engine or not.
                                We need to use a Bosch font, which looks like
                                qml app : !http://burningrain.no-ip.info/images/font_in_qml.png(qml app)!
                                widget app: !http://burningrain.no-ip.info/images/font_in_widget.png(widget app)!

                                Does anyone knows how to improove the presentation of the font in the qt app ?[/quote]

                                1 Reply Last reply
                                0
                                • C Offline
                                  C Offline
                                  culyun
                                  wrote on 3 Dec 2014, 22:45 last edited by
                                  #16

                                  I think all you need is a simple mod to the Qt 5 source.

                                  In

                                  .\qtbase\src\plugins\platforms\windows\qwindowsfontdatabase_ft.cpp

                                  Goto addFontToDatabase

                                  and modify the line that reads

                                  const bool antialias = false;

                                  to

                                  const bool antialias = true;

                                  Rebuild Qt, and voila anti-aliasing on Windows.

                                  [quote author="lunatic fringe" date="1416612075"]At least you can manipulate the arguments for QApplication ...
                                  But i have still difficulties using fonts under windows whether i use the freetype font engine or not.
                                  We need to use a Bosch font, which looks like
                                  qml app : !http://burningrain.no-ip.info/images/font_in_qml.png(qml app)!
                                  widget app: !http://burningrain.no-ip.info/images/font_in_widget.png(widget app)!

                                  Does anyone knows how to improove the presentation of the font in the qt app ?[/quote]

                                  1 Reply Last reply
                                  0
                                  • L Offline
                                    L Offline
                                    lunatic fringe
                                    wrote on 5 Dec 2014, 10:57 last edited by
                                    #17

                                    thanks for the tip, but this does not help :-(

                                    I tried what's been pointed to in that "thead":http://www.qtcentre.org/archive/index.php/t-57280.html with succes but this is currently for me not the way to go

                                    1 Reply Last reply
                                    0
                                    • L Offline
                                      L Offline
                                      lunatic fringe
                                      wrote on 5 Dec 2014, 10:57 last edited by
                                      #18

                                      thanks for the tip, but this does not help :-(

                                      I tried what's been pointed to in that "thead":http://www.qtcentre.org/archive/index.php/t-57280.html with succes but this is currently for me not the way to go

                                      1 Reply Last reply
                                      0
                                      • A Offline
                                        A Offline
                                        aiai99
                                        wrote on 29 Jan 2015, 03:42 last edited by
                                        #19

                                        My application works with Freetype on windows. I compiled Qt source 5.3. but i don't use freetype included in qt source. I download freetype2.5.3 and compile it as DLL using VS.

                                        The step is following.

                                        1. Compile qtbase source using -system-freetype
                                          configure.bat ..... -system-freetype

                                        2. change platformsupport/basic/basic.pri

                                          } else:contains(QT_CONFIG, system-freetype) {
                                          # pull in the proper freetype2 include directory
                                          # include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)

                                               #here is your compiled freetype 
                                               INCLUDEPATH +=C:/projects/freetype-2.5.3/include  
                                               LIBS += -LC:/projects/freetype-2.5.3/lib/x64 -lfreetyped -lfreetype  
                                          

                                        }
                                        3. if necessary, add following into gui/text/text.pri
                                        INCLUDEPATH +=C:/projects/freetype-2.5.3/include
                                        LIBS += -LC:/projects/freetype-2.5.3/lib/x64 -lfreetyped -lfreetype

                                        1. build your qbase

                                        2. enable your application work with freetype
                                          copy your built qt related dll into your application bin dir
                                          copy freetype dll into your application bin dir
                                          create file named qt.conf , append a line

                                          [Platforms]
                                          WindowsArguments = fontengine=freetype

                                        and save qt.conf into your application bin dir

                                        that's all it should work for you.

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          aiai99
                                          wrote on 29 Jan 2015, 03:42 last edited by
                                          #20

                                          My application works with Freetype on windows. I compiled Qt source 5.3. but i don't use freetype included in qt source. I download freetype2.5.3 and compile it as DLL using VS.

                                          The step is following.

                                          1. Compile qtbase source using -system-freetype
                                            configure.bat ..... -system-freetype

                                          2. change platformsupport/basic/basic.pri

                                            } else:contains(QT_CONFIG, system-freetype) {
                                            # pull in the proper freetype2 include directory
                                            # include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)

                                                 #here is your compiled freetype 
                                                 INCLUDEPATH +=C:/projects/freetype-2.5.3/include  
                                                 LIBS += -LC:/projects/freetype-2.5.3/lib/x64 -lfreetyped -lfreetype  
                                            

                                          }
                                          3. if necessary, add following into gui/text/text.pri
                                          INCLUDEPATH +=C:/projects/freetype-2.5.3/include
                                          LIBS += -LC:/projects/freetype-2.5.3/lib/x64 -lfreetyped -lfreetype

                                          1. build your qbase

                                          2. enable your application work with freetype
                                            copy your built qt related dll into your application bin dir
                                            copy freetype dll into your application bin dir
                                            create file named qt.conf , append a line

                                            [Platforms]
                                            WindowsArguments = fontengine=freetype

                                          and save qt.conf into your application bin dir

                                          that's all it should work for you.

                                          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