helloSystem / helloSystem/Utilities

Add a simple font viewer

Open
#87 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29
Forks
30
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.