Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Font rendered in Linux Ubuntu 18.04 is not same as Embedded Linux

Font rendered in Linux Ubuntu 18.04 is not same as Embedded Linux

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 599 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.
  • R Offline
    R Offline
    raj_badam
    wrote on last edited by raj_badam
    #1

    Hi,
    I am using Qt5.6.3,
    I have Qt/QML Application, in which I have loaded the Qt Font as below
    My Application must run on platforms: Windows, Windows CE, Ubuntu 18.04 and Embeded Linux(built using Buildroot)

    In Application, I am loading Font as below

    QFont arialFont("Arial Unicode MS", 15);
    QGuiApplication::setFont(arialFont);
    

    In QML, I show a text as below

    Text
        {
            id: txt
    
            font.pointSize:10
            color: "#1E1E1E"
            elide: Text.ElideRight
            horizontalAlignment: Text.AlignHCenter
            text: "Start Apt"
        }
    

    The text is elided(looks different) in embedded Linux platform when compared with Ubuntu Linux desktop(18.04).

    I managed to match fonts in windows with Ubuntu Linux desktop. By explicitly using freetype font engine in windows desktop.(modifying qt.conf)

    Free type is used in Linux for font rendering and Qt is configured for system freetype. I used different freetype versions(2.9.1, 2.6.1, 2.5.3 and 2.3.12) and didn't see much variation.

    I also gathered font information by logging them.

    Values of font properties that are logged and are same in all platforms:

    Text Width: 52
    Font Point size: 10
    Font Family: Arial Unicode MS
    Font Pixel size: 13
    Font letter spacing: 0
    Font Weight: QFont:: Normal-50
    Font Ratio: 1
    Hinting Preference: PreferDefaultHinting
    Capitalization: Capitalize
    SpacingType: PercentageSpacing
    Stretch: Unstretched
    Style: Normal
    StyleHint: AnyStyle
    StyleStrategy: PreferDefault
    Weight: Normal
    

    Only below property is different

    Text Painted Width: 48.35 in Linux Ubuntu and 47.39 in embedded Linux
    

    Below picture shows the difference:

    Left side is Ubuntu Linux Desktop(18.04) and right is Embedded Linux
    0_1564669743342_diff.png

    Is there any way I can make fonts looks similar in all platforms?

    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