Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61839

Setting "Sans" as default font family causes serif font (DejaVuMathTexGyre.ttf) to be used instead of DejaVuSans

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 5.8.0
    • GUI: Font handling
    • None
    • iMX6.

      Custom Embedded Linux.

    Description

      I'm writing software for an embedded system, that has only the DejaVu TTF font files in it's font directory. Setting "Sans" as font family with QApplication::setFont(QFont("Sans")) selects the only serif font file in the directory called DejaVuMathTexGyre.ttf. By setting font to "DejaVu Sans" the problem can be resolved for the UI-Strings, but this doesn't effect the virtual keyboard for example which uses "Sans" font family.

      Removing the DejaVuMathTexGyre.ttf file causes the call to setFont(QFont("Sans")) to work then for both strings and keyboard.

      The following code:

      bool isSansSerif = (QFont("Sans").styleHint() & QFont::SansSerif);
      bool isSerif = (QFont("Sans").styleHint() & QFont::Serif);
      if(isSansSerif)
      {
          qDebug()<<"Sans";
      }
      if(isSerif)
      {
          qDebug()<<"Serif";
      }
      

      Outputs: "Serif" on Embedded linux as well as on x86_64 Linux.

       

      Attachments

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            mfuerst Marc Führst
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: