1
votes

how to change the font.family of a qml app on android smartphone? I use Qt 5.3.

I've tried to set the QApplication::setFont() and also the font.family property of the qml component: import QtQuick 2.3 import QtQuick.Controls 1.2

ApplicationWindow {

    id: mainWindow
    visible: true
    width: 640
    height: 480

    Text {
        font.pointSize: 24;
        color: Qt.rgba(0.2,0.2,0.2,1);
        font.family: "Courier";
        text: qsTr("MyText");
    }

}

but nothing seems to work.. The only thing that happens on using setFont() is that the font size scale.

1
Have you tried with FontLoader? - Jairo
Yes I've tried FontLoader, but the same - Andreas

1 Answers

7
votes

For Android Jelly Bean, with Qt, listing Font Families returned:

console.log(Qt.fontFamilies())

Android Emoji
AndroidClock
AndroidClock-Large
Clockopia
Droid Arabic Naskh
Droid Naskh Shift Alt
Droid Sans Armenian
Droid Sans Ethiopic
Droid Sans Fallback
Droid Sans Georgian
Droid Sans Hebrew
Droid Sans Mono
Droid Serif
MotoyaLMaru
NanumGothic
Noto Sans
Noto Sans Bengali
Noto Sans Bengali UI
Noto Sans Devanagari
Noto Sans Devanagari UI
Noto Sans Kannada
Noto Sans Kannada UI
Noto Sans Lao
Noto Sans Lao UI
Noto Sans Malayalam
Noto Sans Malayalam UI
Noto Sans Symbols
Noto Sans Tamil
Noto Sans Tamil UI
Noto Sans Telugu
Noto Sans Telugu UI
Noto Sans Thai
Noto Sans Thai UI
Padauk Book
Roboto
Roboto Condensed

The recommended one for "Fixed" is Helvetica.

The best monospace solution, I think is: Droid Sans Mono.

Hope that helps someone in the future looking for this info in the future.