Change base font size depending upon language
Solved
QML and Qt Quick
-
I'm currently adding a Japanese translation for one of the QML based apps that I wrote. For some of the glyphs, it's really hard to discern what they are at the default Qt font size. Looking on Desktop Linux and an Android smartphone, it's quite tiny.
What is the easiest/recommended way to change the base font size based upon the loaded locale?
I have a qtquickcontrols2.conf setup using the only the
Style=Basic
key. Is there some way I could have it change the base font point size when Japanese is loaded? Or could I have a secondary.conf
file made for Japanese? -
I figured out what I can do to get this working. Here's what I did:
- I Copied my existing
qtquickcontrols2.conf
file toqtquickcontrols2_ja_JP.conf
- I modified that
ja_JP.conf
file to add this line at the bottom:Font\PointSize=13
- In my
.qrc
file I added a Language Selector at the bottom:
<!-- Japanese specific resources --> <qresource prefix="/" lang="ja"> <file alias="qtquickcontrols2.conf">qtquickcontrols2_ja_JP.conf</file> </qresource>
This now has the font larger when I load up the app with Japanese set as the locale.
- I Copied my existing