Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. No space between letters in text

No space between letters in text

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 593 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.
  • B Offline
    B Offline
    Bohdan Sh
    wrote on last edited by
    #1

    Hi!

    I'm facing issue with fonts after migration from 5.14 to 6.2. After fixing all compile issues and starting APP there were not a single font showing.

    I tried to start a simple example application from qt creator that simply show ScrollView:

    import QtQuick
    import QtQuick.Controls
    ApplicationWindow {
     id: root
     width: 480
     height: 272
     visible: true
     font.family: "DejaVu Serif";
     ScrollView {
         width: 480
         height: 272
         clip: true
    
         Label {
             text: "A\nBC\tGD"
             font.pixelSize: 24
         }
     }
     Component.onCompleted: console.log("Application font: " + root.font.family + "\n" + "Fonts available: " + Qt.fontFamilies())
    }
    

    And here is output in console:

    QML debugging is enabled. Only use this in a safe environment.
    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/var/volatile/tmp/runtime-root'
    qml: Application font: DejaVu Serif
    Fonts available: DejaVu Sans,DejaVu Sans Mono,DejaVu Serif,Monospace,Sans Serif,Serif
    

    This told me that all the fonts are correct. But text on screen renders as if font.letterSpacing set to zero. If I set font.letterSpacing manually to 20 text is displayed again.

    App is running on Yocto, Qt is build from meta-qt6. Qt was tested with and without fontconfig support.

    Any thoughts what I'm missing?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bohdan Sh
      wrote on last edited by
      #2

      I have had another experiment with fonts. FontsMetrics gives me next results for text with letterSpacing set:

      qml: Font metrics: averageCharacterWidth: 12.84375| boundingRect("AAA"):QRectF(0, -22.0781, 51, 28.7969)
      

      And for letterSpacing not set:

      qml: Font metrics: averageCharacterWidth: 12.84375| boundingRect("AAA"):QRectF(100000, -22.0781, 0, 28.7969)
      
      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