No announcement yet.

system font size (DPI)

  • Filter
  • Time
  • Show
Clear All
new posts

  • system font size (DPI)

    I am sure others must have had this problem before, but I was not able to find a solution in the forum or manual :-(

    If you increase the DPI-size of your windows system fonts it might happen that you can not read the whole contents of a richtext-field any more since the "scaled" contents does not fit into the field any more. Is there any solution like telling AMs to ignore the DPI size and use instead always 100% (default)?

  • #2
    Are you loading an RTF file? If so read up on the "\fs" tag in the raw RTF code.


    • #3
      No, just normal RTF-fields with a defined contents. On my computer (with standard setting 100%) everything is shown correct. On an other computer, which uses a scaling factor of 125%, most of text on my various pages is cut, since it doesn't fit into the fields any more.


      • #4
        Text displayed in RTF controls is scaled by Windows to match the requested dpi resolution. If a user sets a custom text size above 100% to make the texts easier to read, these texts will be made bigger and may not fit into the assigned space. If you want to still show the text in the same size, you need to change the contents of the RTF object. You could have multiple versions of the RTF text to look best in each custom DPI setting, and load the most appropriate one at runtime, or you could change the font sizes used in the document on the fly via Lua script, which may work on simpler documents.

        Click image for larger version

Name:	SNAG-2012-12-03-07.png
Views:	1
Size:	52.3 KB
ID:	283865

        Here you can see how the same application looks at a 100% (96 dpi), 125% (120 dpi), 150% (144 dpi) and even a 200% (192 dpi) setting. Clearly the window size is changed by Windows to accommodate the title bar and controls, but as you can see, the RTF control shows the text in a consistent size. This is achieved by changing the RTF document via Lua. If the document is changed, a Debug window will be shown, explaining what is being done.

        This is a very simple example. If, instead of shipping appropriate documents for each DPI setting, you attempt to follow this route, you need to add code to make sure that once a RTF was changed it does not get altered (resized) again when you revisit the same page again.

        Last edited by Ulrich; 12-03-2012, 09:08 AM. Reason: Typo, as usual.


        • #5
          Dear Ulrich, as always, thank you very much for your support. The answer you gave is what I expected. With your great example it will be easy to implement the needed code in my project.