QML can't see font ascender on Embedded device
-
Hi All,
I have some problems to correctly visualize the font Helvetica Neue LT Std Font on an embedded device. The problem is that i 'cant see the part of the characters that are in the ascender area of the font, for example i can't see the accent of the char "À". But also for example the symbol ^ above the char "ê" is cutten. Checking the font with fontdrop.info i can confirm that the part of the characters that are cutten is the part in the ascender area.
If i run the application on PC, it works fine.
My embedded device is based on a iMx6 ULL processor. The screen resolution is 800x480.Below the test code I am using. I'm using Qt5.8.0 both for embedded and PC.
main.cpp
{ QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); QtQuick2ApplicationViewer viewer; viewer.setSurfaceType(QSurface::OpenGLSurface); // Force orientation to see Maliit in landscape orientation QFont font("HelveticaNeueLTStd"); font.setStretch(QFont::Condensed); app.setFont(font); viewer.setMainQmlFile(QStringLiteral("main.qml")); QObject::connect((QObject*)viewer.engine(), SIGNAL(quit()), &app, SLOT(quit())); viewer.showExpanded(); return app.exec(); }
main.qml
import QtQuick 2.6 import QtQuick.Window 2.2 Window { visible: true width: 800 height: 480 Text { id: textEdit text: qsTr("ÀÀÀ") font.pointSize: 24 verticalAlignment: Text.AlignVCenter anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter anchors.topMargin: 20 } }
Thanks!
Caro -
Hi All,
I have some problems to correctly visualize the font Helvetica Neue LT Std Font on an embedded device. The problem is that i 'cant see the part of the characters that are in the ascender area of the font, for example i can't see the accent of the char "À". But also for example the symbol ^ above the char "ê" is cutten. Checking the font with fontdrop.info i can confirm that the part of the characters that are cutten is the part in the ascender area.
If i run the application on PC, it works fine.
My embedded device is based on a iMx6 ULL processor. The screen resolution is 800x480.Below the test code I am using. I'm using Qt5.8.0 both for embedded and PC.
main.cpp
{ QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); QtQuick2ApplicationViewer viewer; viewer.setSurfaceType(QSurface::OpenGLSurface); // Force orientation to see Maliit in landscape orientation QFont font("HelveticaNeueLTStd"); font.setStretch(QFont::Condensed); app.setFont(font); viewer.setMainQmlFile(QStringLiteral("main.qml")); QObject::connect((QObject*)viewer.engine(), SIGNAL(quit()), &app, SLOT(quit())); viewer.showExpanded(); return app.exec(); }
main.qml
import QtQuick 2.6 import QtQuick.Window 2.2 Window { visible: true width: 800 height: 480 Text { id: textEdit text: qsTr("ÀÀÀ") font.pointSize: 24 verticalAlignment: Text.AlignVCenter anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter anchors.topMargin: 20 } }
Thanks!
Caro@carols is it possible that you run any other non-Qt application in that device to see what happens with the font in that case?
-
@Pablo J. Rogina thanks for your reply! Unfortunately is not easy for me in this moment to try with a no Qt Application. Do you think it could be related to the configuration of fonts on my embedded platform?
@carols said in QML can't see font ascender on Embedded device:
Do you think it could be related to the configuration of fonts on my embedded platform?
I cannot tell for sure, but I do remember some issues in the forum due to the actual font file in the device not the exact same file in the PC although having the same name...
-
Hi,
Did you check that you are actually getting the font you are requesting on your device ?
-
@SGaist thanks for the reply! Yes the font is the one that i'm requesting. I made this test: i changed the font with a font editor, i moved the letter "À" in way that the symbol above the A is under the line "ascender". In this way i can see the letter correctly. So it is a confirm that the font that i'm using is the correct one and that the problem is in the visualization of the symbol or of the part of a character that are above the "ascender" line. Please help!
-
After other tests i verified that this issue is related to some problem in the rendering of the font.
So in the end i chose a simpler solution: i edited the font moving the "ascender" line upper in a way that now all the symbols are under this line. And now i can see alle the symbols correctly! -
Glad you found a solution and thanks for sharing !
That's a nice trick !