Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How does Qt/Embedded load multi fonts
Qt 6.11 is out! See what's new in the release blog

How does Qt/Embedded load multi fonts

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 3.9k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    leasia
    wrote on last edited by
    #1

    My Qt/E library version is 4.6.2, and the base platform is embedded linux, without X11 system.

    By default, QFontDatabasePrivate will index all the fonts that in directory QTEDIR/lib/fonts, and QApplication will set default font "DejaVu Sans".

    There is no Chinese characters in "DejaVu Sans", so my application can't display Chinese. Then I add some "wenquanyi" fonts to directory QTEDIR/lib/fonts, but Qt can't use it functionally, I have to call setFont function in main function or add para "-font wenquanyi" when start my application. I think it is not very flexible.

    If my language enviroment is English, all the Chinese website can't display normally; If I set system font with "wenquanyi", the Latin characters are unbeautiful. Further, every font can't contain all the languages that we need, so there are multi requisite fonts in my system (for example: DejaVu Sans, wenquanyi, Korean and so on). I don't know how to solve this problem.

    How can I load multi font for QApplication? I want to use DejaVu Sans by default, when some UI pages have chinese characters, Qt will load and use "wenquanyi" automatic. How can I do? Or is there any other method to solve it?

    Thanks!

    1 Reply Last reply
    0

    • Login

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