Solved Chinese Fonts on the Raspberry Pi 3
-
@bask185 Do you have this problem when running your app in PIXEL?
-
@jsulm said in Chinese Fonts on the Raspberry Pi 3:
@bask185 Do you have this problem when running your app in PIXEL?
Yes, and because of some slowness bug I have to boot to Pixel. When I boot to the CLI the app runs significantly slower for some reason.
-
@bask185 I guess if you boot to CLI you get framebuffer device without any hardware acceleration. In this case it is not a bug.
-
@jsulm That the cause of something might have a perfectly clear reason, does not mean that something isn't a bug persé. That slow running bug was one helluva annoying bug to me, whatever the reason may be.
But how does this help me teach the Raspberry speak Chinese?
-
@bask185 said in Chinese Fonts on the Raspberry Pi 3:
But how does this help me teach the Raspberry speak Chinese?
It does not, I just wanted to say that framebuffer devices do not have hardware acceleration and this can be the reason for slow UI.
-
Well I narrowed down the folder out of which the application picks it's fonts. If I leave 1 font, she will pick that one. So I could modify the font in the application.
/usr/local/qt5pi/lib/fonts
I vaguely remembered I once had no texts at all, so I dug up some e-mails and I remembered I had to manually copy paste fonts into the folder. What I however don't know is how the app picks one of them. I know it does not pick the first on the list.
www.qtrpi.com's FAQ had a step with which I had to add an export line to .basrc. I think that that line was supposed to copy ttf files to that folder. But that did not work for me.
I already downloaded a chinese font, but now everything were squares.
I now only have to find and copy a complete .ttf file in that folder, that ought to teach this Raspberry some Chinese...
-
Well I finally have me some Chinese characters, it was indeed copying a suitable .ttf to the fonts folder. I still dont have Thai though :D
I just found a website with which you can open .ttf files so you can look for your unicodes/characters. I only wish I would have thought of this earlier.. like before I solved the file. I still don't know if Qt can work with 2 or more different font files.... all the plain text is kinda ugly now :D
CharMap -
@bask185
Hi
Qt can use any font installed on the system.
You can even use custom fonts not installed with
QFontDatabase::addApplicationFont("qrc:///resources/Triforce.ttf");
https://forum.qt.io/topic/57772/using-custom-fonts -
Yeah I came across the QFontDatabase in my 'Quest' for the solution. But not long after, I knew which folder my app was using for fonts. At that point I only had to find a decent Chinese and Thai font.
For me it does not really matter whether the app picks a font out of the resource folder or the "/usr/local/qt5pi/lib/" fonts folder. Well that is not true, it does matter because now I do not have to learn how QFontDatabase works and produce (redundant) lines of code :P + if I want to add a new .ttf, I merely have to download and move the file to the folder. If I would use the resource folder instead I would also have to add a line of code in the app to include that font.
My project is almost done now. So I will update my report and clone the Pi's SD card. My superior was impressed ;)
-
-
@bask185 You may like Google Noto fonts https://www.google.com/get/noto/.