Utilities icon indicating copy to clipboard operation
Utilities copied to clipboard

Add a simple font viewer

Open probonopd opened this issue 4 years ago • 2 comments

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?

probonopd avatar Oct 03 '21 20:10 probonopd

I did add a PR with a fonts app didn't I?

kettle-7 avatar Oct 04 '21 20:10 kettle-7

If you did, then it was totally lost on me. Where?

probonopd avatar Oct 04 '21 21:10 probonopd