Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Change base font size depending upon language
QtWS25 Last Chance

Change base font size depending upon language

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 254 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Ben SB Offline
    Ben SB Offline
    Ben S
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • Ben SB Offline
      Ben SB Offline
      Ben S
      wrote on last edited by Ben S
      #2

      I figured out what I can do to get this working. Here's what I did:

      1. I Copied my existing qtquickcontrols2.conf file to qtquickcontrols2_ja_JP.conf
      2. I modified that ja_JP.conf file to add this line at the bottom: Font\PointSize=13
      3. 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.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved