Notice

The forum is in read only mode.

  • Page:
  • 1

TOPIC: Screen Resolution and Printing

Screen Resolution and Printing 6 years 3 months ago #3331

A few years ago we had problems with customers who'd set their screen DPI > 100% getting improper font sizes on print outs. I started a thread on the old newsgroup and eventually got the answer. We had to make the program "DPI Aware" and then we had to check a ratio which had one value in XP and another in Vista and probably Windows 7 and then we had to add a factor into the conversion of screen resolution to printer resolution depending upon the answer. Everything worked until recently.

I'm starting to get reports from some Windows 8 users and Windows 10 users that unless they use 100% the printing is off again. At least Windows 10 uses 100% as the default and recommended setting but something has changed.

Has anyone been down this path in Windows 10? I can post the code that used to work if that would be helpful.

Screen Resolution and Printing 6 years 3 months ago #3336

Generally, screen DPI should not have effects of printing. Posting some code that exhibits the problem would be useful.

Windows 8.1 has introduced per-monitor dpi awareness and that is most likely the source of your problem. You have made your apps DPI-aware, but they are not per-monitor DPI aware. Adding following section in your app manifest will make app per-monitor DPI aware.

<pre class="lang-pascal prettyprint prettyprinted" style="margin-top: 0px; border: 0px; font-size: 13px; overflow: auto; width: auto; max-height: 600px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; color: #393318; word-wrap: normal; background-color: #eeeeee;"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"> <span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;"><</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">asmv3</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">:</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">application</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">></span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">
</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;"><</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">asmv3</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">:</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">windowsSettings xmlns</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">="</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">http</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">:</span><span class="com" style="margin: 0px; padding: 0px; border: 0px; color: #808080;">//schemas.microsoft.com/SMI/2005/WindowsSettings"></span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">
</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;"><</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">dpiAware</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">></span><span class="lit" style="margin: 0px; padding: 0px; border: 0px; color: #800000;">true</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">/</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">PM</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;"></</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">dpiAware</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">></span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">
</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;"></</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">asmv3</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">:</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">windowsSettings</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">></span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">
</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;"></</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">asmv3</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">:</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">application</span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: #000000;">></span></code></pre>
You can read more at http://stackoverflow.com/q/26852150/4267244

But please note that Delphi VCL and FMX do not support per-monitor DPI and if you mark your app as per-monitor DPI aware you will have to process WM_DPICHANGED message and rescale your forms at runtime https://msdn.microsoft.com/en-us/library/windows/desktop/dn312083(v=vs.85).as px

VCL and FireMonkey lack Per-Monitor DPI support for Windows 8.1 (and Windows 10) quality.embarcadero.com/browse/RSP-9679

Screen Resolution and Printing 6 years 3 months ago #3576

We'll check that out although I seriously doubt that any of our users have more than one monitor. We haven't been able to pin down the situation that is causing the problem. It doesn't seem to be every user of Windows 8.1 or 10, but we are definitely seeing some users have font size issues when printing if they set the screen dpi to something greater than 100%. We went looking for the code we used to fix a font scaling problem we had before we introduced dpi awareness and discovered that it was in a completely different part of our program and can not be the same problem we're seeing now. In fact, the new problem may only be happening with particular fonts. For example, New Times Roman may not be printing in the proper size when the screen dpi is 125% while other fonts are unaffected.

So ... we're beginning to think the problem could be in some individual True Type Fonts and not in our program at all. The fonts in question are in government forms that our application prints. The next time we get a report of this particular problem, we'll send the user a new version of the form that uses a different font and see if that fixes it.
  • Page:
  • 1
Moderators: April Anne