Created
April 6, 2018 21:44
-
-
Save mhoeher/b47a593f1aad3c5fa96fe3ccc5a5826f to your computer and use it in GitHub Desktop.
QML Font Weights - Comparison Comfortaa - Font Awesome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.9 | |
import QtQuick.Controls 2.2 | |
ApplicationWindow { | |
Component.onCompleted: { | |
console.debug(comfortaaLight.name); | |
console.debug(comfortaaRegular.name); | |
console.debug(comfortaaBold.name); | |
show(); | |
} | |
FontLoader { | |
id: comfortaaLight | |
source: "./Comfortaa-Light.ttf" | |
} | |
FontLoader { | |
id: comfortaaRegular | |
source: "./Comfortaa-Regular.ttf" | |
} | |
FontLoader { | |
id: comfortaaBold | |
source: "./Comfortaa-Bold.ttf" | |
} | |
Column { | |
anchors.centerIn: parent | |
Label { | |
font.family: comfortaaLight.name | |
font.weight: Font.Thin | |
font.pointSize: 20 | |
text: qsTr("Comfortaa Thin") | |
} | |
Label { | |
font.family: comfortaaLight.name | |
font.weight: Font.Light | |
font.pointSize: 20 | |
text: qsTr("Comfortaa Light") | |
} | |
Label { | |
font.family: comfortaaLight.name | |
font.weight: Font.ExtraLight | |
font.pointSize: 20 | |
text: qsTr("Comfortaa ExtraLight") | |
} | |
Label { | |
font.family: comfortaaLight.name | |
font.weight: Font.Normal | |
font.pointSize: 20 | |
text: qsTr("Comfortaa Normal") | |
} | |
Label { | |
font.family: comfortaaLight.name | |
font.weight: Font.Medium | |
font.pointSize: 20 | |
text: qsTr("Comfortaa Medium") | |
} | |
Label { | |
font.family: comfortaaLight.name | |
font.weight: Font.DemiBold | |
font.pointSize: 20 | |
text: qsTr("Comfortaa DemiBold") | |
} | |
Label { | |
font.family: comfortaaLight.name | |
font.weight: Font.Bold | |
font.pointSize: 20 | |
text: qsTr("Comfortaa Bold") | |
} | |
Label { | |
font.family: comfortaaLight.name | |
font.weight: Font.ExtraBold | |
font.pointSize: 20 | |
text: qsTr("Comfortaa ExtraBold") | |
} | |
Label { | |
font.family: comfortaaLight.name | |
font.weight: Font.Black | |
font.pointSize: 20 | |
text: qsTr("Comfortaa Black") | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.9 | |
import QtQuick.Controls 2.2 | |
ApplicationWindow { | |
Component.onCompleted: { | |
console.debug(faRegular.name); | |
console.debug(faSolid.name); | |
show(); | |
} | |
FontLoader { | |
id: faRegular | |
source: "./fa-regular-400.ttf" | |
} | |
FontLoader { | |
id: faSolid | |
source: "./fa-solid-900.ttf" | |
} | |
Column { | |
anchors.centerIn: parent | |
Text { | |
font.family: faRegular.name | |
font.weight: Font.Thin | |
font.pointSize: 20 | |
text: qsTr("FontAwesome Thin - \uf111 \uf2bd \uf059") | |
} | |
Text { | |
font.family: faRegular.name | |
font.weight: Font.Light | |
font.pointSize: 20 | |
text: qsTr("FontAwesome Light - \uf111 \uf2bd \uf059") | |
} | |
Text { | |
font.family: faRegular.name | |
font.weight: Font.ExtraLight | |
font.pointSize: 20 | |
text: qsTr("FontAwesome ExtraLight - \uf111 \uf2bd \uf059") | |
} | |
Text { | |
font.family: faRegular.name | |
font.weight: Font.Normal | |
font.pointSize: 20 | |
text: qsTr("FontAwesome Normal - \uf111 \uf2bd \uf059") | |
} | |
Text { | |
font.family: faRegular.name | |
font.weight: Font.Medium | |
font.pointSize: 20 | |
text: qsTr("FontAwesome Medium - \uf111 \uf2bd \uf059") | |
} | |
Text { | |
font.family: faRegular.name | |
font.weight: Font.DemiBold | |
font.pointSize: 20 | |
text: qsTr("FontAwesome DemiBold - \uf111 \uf2bd \uf059") | |
} | |
Text { | |
font.family: faRegular.name | |
font.weight: Font.Bold | |
font.pointSize: 20 | |
text: qsTr("FontAwesome Bold - \uf111 \uf2bd \uf059") | |
} | |
Text { | |
font.family: faRegular.name | |
font.weight: Font.ExtraBold | |
font.pointSize: 20 | |
text: qsTr("FontAwesome ExtraBold - \uf111 \uf2bd \uf059") | |
} | |
Text { | |
font.family: faRegular.name | |
font.weight: Font.Black | |
font.pointSize: 20 | |
text: qsTr("FontAwesome Black - \uf111 \uf2bd \uf059") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment