Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for MCUs
  4. How to Optimize Font Memory Usage in Qt for MCUs 2.7.1 (fontcompiler-args not supported)
Forum Updated to NodeBB v4.3 + New Features

How to Optimize Font Memory Usage in Qt for MCUs 2.7.1 (fontcompiler-args not supported)

Scheduled Pinned Locked Moved Unsolved Qt for MCUs
5 Posts 3 Posters 164 Views 2 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.
  • S Offline
    S Offline
    say_1
    wrote 8 days ago last edited by
    #1

    Hi everyone,
    I'm working on a project using Qt for MCUs 2.7.1, and I'm currently facing a memory optimization issue related to fonts.

    Setup Details:

    • Qt version: 2.7.1 (mandatory due to customer constraint)
    • Toolchain: IAR
    • Fonts used: TTF
    • .qmlproject is exported using a .bat file that calls qmlprojectexporter.exe

    The generated file qul_font_engines.cpp alone is taking up around 3636 KB of memory, which is too large for our current memory constraints.
    My goal is to bring this down under 1000 KB if possible.

    What I've Already Tried (Please Don't Suggest These Again šŸ™‚):

    • --fontcompiler-args option in the .bat file:
    • I tried using --fontcompiler-args "--chars=0123456789"
    • Result: Not supported in Qt for MCUs 2.7.1 → shows Unknown options: fontcompiler-args, chars
    • Verified fontcompiler.exe is present in 2.7.1, but CLI option is still not supported.
    • Cannot upgrade to Qt 2.8.0 or later due to customer-mandated toolchain freeze.
    • Tried setting font size lower in QML (font.pixelSize: 16) and limited font styles (font.bold/italic: false) → helped marginally but not enough.
    • Started reviewing QML files to eliminate unused text/glyphs.

    What I'm Looking For:

    • Are there any other ways in Qt for MCUs 2.7.1 to reduce the font memory footprint without relying on unsupported CLI arguments?
    • Is there a way to use fontCompilerOptions inside .qmlproject or .qmlprojectconfig that can limit the character set?
    • Can I manually run fontcompiler.exe to generate .qulfnt files and use them directly in my .qmlproject?
    • Any other suggestions to significantly reduce qul_font_engines.cpp size?

    Any advice or experience you can share would be greatly appreciated!
    Thanks in advance
    — Sayali

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote 7 days ago last edited by
      #2

      Hi and welcome to devnet,

      First thing, sorry, I don't have experience with Qt for MCU. That said I was wondering: is just replacing qmlprojectexporter from 2.7.1 by the one from 2.8.2 an option ? The rest stays the same.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        say_1
        wrote 6 days ago last edited by
        #3

        Hi,
        Thank you so much for taking the time to respond — I really appreciate it.
        Yes, I have previously tried using the qmlprojectexporter from Qt for MCUs 2.8.2 while keeping the rest of the toolchain and setup on 2.7.1. The project compiles successfully with that approach.
        However, even with the 2.8.2 exporter, I did not observe any noticeable reduction in the generated font file size. The memory usage for qul_font_engines.cpp remains almost the same, which is the core issue I'm trying to address.
        Thanks again for your input — happy to hear any further ideas you might have!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          say_1
          wrote 3 days ago last edited by
          #4

          As a continuation of my earlier post regarding memory optimization, I switched the font engine from Static to Spark in my Qt for MCUs project to reduce memory footprint.

          I would like to understand the following:

          What specific library files are required when using the Spark font engine on an embedded environment?

          How should these libraries be linked or added to the build process to avoid runtime errors?

          Is there any documentation or steps specific to ensuring the Spark engine works properly during integration with an application?

          The build works fine on my side, but once integrated into the larger system, it fails unless the missing library is resolved.

          Any help or direction on resolving this and properly setting up Spark would be appreciated.

          J 1 Reply Last reply a day ago
          0
          • S say_1
            3 days ago

            As a continuation of my earlier post regarding memory optimization, I switched the font engine from Static to Spark in my Qt for MCUs project to reduce memory footprint.

            I would like to understand the following:

            What specific library files are required when using the Spark font engine on an embedded environment?

            How should these libraries be linked or added to the build process to avoid runtime errors?

            Is there any documentation or steps specific to ensuring the Spark engine works properly during integration with an application?

            The build works fine on my side, but once integrated into the larger system, it fails unless the missing library is resolved.

            Any help or direction on resolving this and properly setting up Spark would be appreciated.

            J Online
            J Online
            jsulm
            Lifetime Qt Champion
            wrote a day ago last edited by
            #5

            @say_1 said in How to Optimize Font Memory Usage in Qt for MCUs 2.7.1 (fontcompiler-args not supported):

            What specific library files are required when using the Spark font engine on an embedded environment?

            You can check the direct dependencies of a library by using the ldd tool.

            "How should these libraries be linked or added to the build process to avoid runtime errors?" - not at all. You just need to make sure these libs are installed on the target machine.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            3/5

            11 Jun 2025, 06:24

            • Login

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