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

Program crash when using a specific glyph from a popular font file on Linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.5.4, 6.6.2, 6.7.0
    • GUI: Font handling
    • None
    • Linux/X11

    Description

      When trying to use a specific glyph (the code icon - '\uf121') from the popular FontAwesome font, the app crashes.

      I'm loading the font via QML FontLoader.

       

      OS: Pop!_OS 22.04 LTS 64bit

      GNOME version: 42.9

      Windowing system: X11

       

      Here's an easy way to reproduce this (I've attached the font file, but you can also download it here):

       

      Main.qml

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      
      Window {
          id: root
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")    
      
          readonly property FontLoader fontAwesomeSolid: FontLoader {
              source: "qrc:/Test/fa-solid-900.ttf"
          }    
      
           Text {
              anchors.centerIn: parent
              text: "\uf121" //f144 works
              font.family: fontAwesomeSolid.name
              color: "black"
              font.pointSize: 20
          }
      }
       

       

      fonts.qrc

       

      <RCC>
          <qresource prefix="/">
              <file>fa-solid-900.ttf</file>
          </qresource>
      </RCC> 

       

       

      CMakeLists.txt

       cmake_minimum_required(VERSION 3.16)
      project(Test VERSION 0.1 LANGUAGES CXX)
      set(CMAKE_CXX_STANDARD_REQUIRED ON)
      find_package(Qt6 6.4 REQUIRED COMPONENTS Quick)
      qt_standard_project_setup()
      qt_add_executable(appTest
          main.cpp
      )
      qt_add_qml_module(appTest
          URI Test
          VERSION 1.0
          QML_FILES Main.qml TextSelectionMenu.qml
      )
      qt_add_resources(appTest "fonts"
          PREFIX "/Test"
          FILES fa-solid-900.ttf
      )
      set_target_properties(appTest PROPERTIES
          MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
          MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
          MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
          MACOSX_BUNDLE TRUE
          WIN32_EXECUTABLE TRUE
      )
      target_link_libraries(appTest
          PRIVATE Qt6::Quick
      )
      install(TARGETS appTest
          BUNDLE DESTINATION .
          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
      ) 

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            rubymamis Ruby Mamistvalove
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes