Utilities
Utilities copied to clipboard
Add a simple font viewer
Currently helloSystem does not know what to do with font files.
Thought this was a good use case for pure Qml:
#!/usr/bin/env qml
import QtQuick 2.15
Item {
width: 480; height: 300
FontLoader {
id: loadedFont; source: Qt.application.arguments[2]
}
Text {
text: "Hamburgefonstiv"
font.family: loadedFont.font.family
font.weight: loadedFont.font.weight
font.pixelSize: 48
}
}
But:
FreeBSD% Desktop/fontviewer.qml /usr/local/share/fonts/SourceCodePro/SourceCodePro-Black.ttf
file:///usr/home/user/Desktop/fontviewer.qml:15: TypeError: Cannot read property 'weight' of undefined
file:///usr/home/user/Desktop/fontviewer.qml:14: TypeError: Cannot read property 'family' of undefined
file:///usr/home/user/Desktop/fontviewer.qml:15: TypeError: Cannot read property 'weight' of undefined
file:///usr/home/user/Desktop/fontviewer.qml:14: TypeError: Cannot read property 'family' of undefined
QQmlApplicationEngine failed to load component
file:///usr/local/share/fonts/SourceCodePro/SourceCodePro-Black.ttf:1:1: Expected token `numeric literal'
Why Expected token 'numeric literal'? How to fix?
I did add a PR with a fonts app didn't I?
If you did, then it was totally lost on me. Where?