0

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.

vsz
  • 225
  • 2
  • 12

1 Answers1

0

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.

vsz
  • 225
  • 2
  • 12