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. How to use a custom font in Qt Installer Framework?
QtWS25 Last Chance

How to use a custom font in Qt Installer Framework?

Scheduled Pinned Locked Moved Solved General and Desktop
qt installercustom fontfontqtinstaller
3 Posts 2 Posters 759 Views
  • 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.
  • SamurayHS Offline
    SamurayHS Offline
    SamurayH
    wrote on last edited by SamurayH
    #1

    Hi,
    I'm trying to use a custom font for my installer by it doesn't work.
    In the documentation of binarycreator they say that : "In the optional resource files specified via the --resources parameter, a special fonts/ path can be used to ship custom fonts. . These fonts will be loaded automatically and thus become available in a stylesheet which can be specified via the StyleSheet variable."

    So I'm using the following command to build the installer:

    binarycreator -c config\config.xml -p packages MyAppSetup.exe -r ./fonts/;
    

    and I set the font like this (in config/style.qss):

    QWidget {
        background-color: #323232;
        color: #e6e6e6;
        font: 9pt  'MyFont'; 
    }
    

    however the installer doesn't display the correct font unless it's already installed in the system.

    I'm assuming it's a bug, but not sure, any ideas?

    "قال رسول الله صلى الله عليه وسلم : " أحب الناس إلى الله أنفعهم للناس

    1 Reply Last reply
    0
    • SamurayHS Offline
      SamurayHS Offline
      SamurayH
      wrote on last edited by
      #2

      Ok I've solved it.
      It was my fault, the -r parameter must have a list of Qt Resource files..
      I got a bit confused with the fonts/ path, I though it was a folder but it's a prefix path a Qt Resource file (.qrc):

      <RCC>
          <qresource prefix="/fonts">
              <file>MyFont.TTF</file>
          </qresource>
      </RCC>
      

      and the command:

      binarycreator -c config\config.xml -p packages -r resources/rc.qrc MyAppSetup.exe
      

      "قال رسول الله صلى الله عليه وسلم : " أحب الناس إلى الله أنفعهم للناس

      W 1 Reply Last reply
      0
      • SamurayHS SamurayH

        Ok I've solved it.
        It was my fault, the -r parameter must have a list of Qt Resource files..
        I got a bit confused with the fonts/ path, I though it was a folder but it's a prefix path a Qt Resource file (.qrc):

        <RCC>
            <qresource prefix="/fonts">
                <file>MyFont.TTF</file>
            </qresource>
        </RCC>
        

        and the command:

        binarycreator -c config\config.xml -p packages -r resources/rc.qrc MyAppSetup.exe
        
        W Offline
        W Offline
        WHNM-DHZ
        wrote on last edited by
        #3

        @SamurayH I have encountered a similar problem and do not know how to solve it. It's not valid here either

        QCheckBox::indicator:checked {
        image: url(img/checked_on_normal);
        }
        QCheckBox::indicator:unchecked {
        image: url(img/checked_off_normal);
        }
        
        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