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

    • Linux/X11
    • b959b8f5e (dev), 2370cb0eb (dev), 260685d1e (6.8), f7c05cb53 (6.7), cb94f9d71 (tqtc/lts-6.5), 06304f931 (tqtc/lts-6.2), e180e5335 (6.8), a1c733ff1 (6.7), 7ce983a4b (tqtc/lts-5.15), a0a2f3b58 (tqtc/lts-6.5), 6600cbea3 (tqtc/lts-6.2)

    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:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: