Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Cannot find font error on runtime #4

Open
asdf23 opened this issue Sep 14, 2023 · 2 comments
Open

Cannot find font error on runtime #4

asdf23 opened this issue Sep 14, 2023 · 2 comments

Comments

@asdf23
Copy link

asdf23 commented Sep 14, 2023

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
Copy link
Author

asdf23 commented Sep 14, 2023

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

@asdf23
Copy link
Author

asdf23 commented Sep 14, 2023

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

hmpthcs added a commit to hmpthcs/writeboard that referenced this issue Oct 29, 2023
per user asdf23's issue (folfcoder#4), fixed missing font resource in CMakeLists.txt
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant