I'm using EGLFS for graphics (via Qt Quick), and the only font there seems to exist is a very ugly serif font.

I downloaded OpenSans, copied it into usr/local/share/fonts, but it doesn't work. Copying the same ttf files into the same folder on a Debian PC works fine.

Text { font.family: "OpenSans"; text: "The quick brown fox jumps over the lazy dog" }

I tried several well-known font names which are included in almost any system, without success.

I also tried the suggestions found at Qt for Embedded, but /lib/fonts also didn't work.

I use the default Raspbian which came pre-installed with the devoce.

Interestingly, the xserver on my Pi uses a sans-serif font for its GUI. However, I guess it does not have much to do with my problem, as my GUI application works properly even if the xserver is not started.


One solution would be to embed the fonts into the application. Put a FontLoader fairly early into the main application window, for example:

FontLoader {id: customName; source:"qrc:///fonts/OpenSans-Regular.ttf"}

And use it later:

Text { font.family: customName.name; text: "xyz" }

One disadvantage is that if you have multiple applications using it, you have to embed the fonts into each of them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.