Re: Load fonts from disk.
Have you tried passing the filename as a file: URI?
E.g. assuming that the QML file is in the same directory as the font, something like
Code:
source: Qr.resolveUrl("1.ttf");
Cheers,
_
Re: Load fonts from disk.
Following your advice, I tried to place the font-file in all projects folders (that Qt found it for sure) and wrote:
Code:
source: Qt.resolvedUrl("1.ttf");
but i got the same: QML FontLoader: Cannot load font: "qrc:/1.ttf"
Re: Load fonts from disk.
Well, your QML file is apparently not loaded from disk but from the Qt resource system.
resolveUrl() creates an URL relative to the QML file.
You can put the font into the resource as well, or use a different way to construct the file URI for the on-disk file.
Cheers,
_
Re: Load fonts from disk.
Quote:
Originally Posted by
anda_skoa
Well, your QML file is apparently not loaded from disk but from the Qt resource system.
resolveUrl() creates an URL relative to the QML file.
You can put the font into the resource as well, or use a different way to construct the file URI for the on-disk file.
Cheers,
_
Yes! After i add the font-file into the resource problem disappeared. Thanks for the help!