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.6k 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.
  • I Offline
    I Offline
    iamsergio
    wrote on 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 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 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 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 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 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 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 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 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 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 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 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 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 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