Freetype font rendering on Windows?



  • 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!



  • 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...



  • [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...



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

    Me too. No feedback yet ?



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

    to your app



  • 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 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 ?



  • 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]



  • 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.



  • 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.



  • 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]



  • 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]



  • 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 ?



  • 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 ?



  • 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]



  • 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]



  • 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



  • 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



  • 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  
      

    }

    1. 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

    2. build your qbase

    3. 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.



  • 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  
      

    }

    1. 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

    2. build your qbase

    3. 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.