Add custom font for Quick Controls 2 in Android
-
wrote on 14 Jan 2017, 10:44 last edited by
Dear Guys
Is it possible to add custom font in Qt Quick Controls 2 Android Application like font face?
In android it's possible to add custom font
Thanks -
@Advanced Add you custom fonts inside resource files and load them as:
- In QML using FontLoader load and assign them to each QML component's attached property
font.family
- Use QFont and apply it globally by setting it to
QGuiApplication
.
- In QML using FontLoader load and assign them to each QML component's attached property
-
wrote on 2 Mar 2017, 12:12 last edited by
If you consider using V-Play, you could also set the font app-wide from QML
import VPlayApps 1.0 import QtQuick 2.5 App { onInitTheme: { Theme.normalFont = arialFont } FontLoader { id: arialFont source: "fonts/Arial.ttf" // loaded from your assets folder } Page { AppText { text: "I'm in Arial" } } }
-
wrote on 2 Mar 2017, 12:27 last edited by
With Qt Quick Controls 2, you can specify a custom font in QML:
Qt Quick Controls 2 provides natural inheritance for fonts. Specifying a custom font at window level means that the font propagates to all child controls and popups in the window. And when specifying a custom font for a control/popup, the font propagates to its child controls.
-
With Qt Quick Controls 2, you can specify a custom font in QML:
Qt Quick Controls 2 provides natural inheritance for fonts. Specifying a custom font at window level means that the font propagates to all child controls and popups in the window. And when specifying a custom font for a control/popup, the font propagates to its child controls.