folfcoder / writeboard

Handwriting input for Linux desktops.
GNU General Public License v3.0
28 stars 2 forks source link

Cannot find font error on runtime #4

Open asdf23 opened 1 year ago

asdf23 commented 1 year ago

When I run the program I see an error:

$ ./writeboard
qrc:/Writeboard/Main.qml:14:5: QML FontLoader: Cannot load font: "qrc:/Writeboard/fonts/icons.woff2"

I searched cyberspace and found this tip:

As for using qrc: did you create a proper Qt resource to make use of it ?

I'm not familiar with QT, so sorry I'm not much help

asdf23 commented 1 year ago

Btw, this error was found on the X instance that showed the icons correctly (not the image with the "8" icon)

asdf23 commented 1 year ago

Changing CMakeLists.txt to

...snip...
# qt_standard_project_setup()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

qt_add_executable(writeboard
    main.cpp
)

qt_add_qml_module(writeboard
    URI Writeboard
    VERSION 1.0
    QML_FILES Main.qml
    RESOURCES "fonts/icons.woff2"
)
...snip...

seems to fix this error