0

In Qt Application I have loaded the QtFont as below

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

In Qml I have a text component

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 am using Qt 5.6.3.

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 the values:

Values of font properties that are logged and are same in both the 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

Different values logged:

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

Note: Also built the qt application in Windows with using system freetype, font rendering was same as Ubuntu Linux Desktop.

Below picture shows the difference Left side is Ubuntu Linux Desktop(18.04) and right is Embedded Linux Click here for image

Expecting Font should be similar in both the Linux platforms

  • Try checking your DPI settings. – n. m. could be an AI Aug 01 '19 at 16:09
  • Thanks, tried DPI values. Target Display has 116 dpi where as desktop dpi is 96 by default. I forced DPI in target to 96. Now I see fonts are near by to desktop, but still exactly not same as in desktop. – Rajendra Badam Aug 13 '19 at 12:22
  • Do you really have the same fonts installed on both platforms? If the requested font is not installed, freetype will look for a substitution font. – Arnout Aug 15 '19 at 10:45

0 Answers0