<div dir="ltr"><div dir="auto"><div>Hello Thiago,</div><div><br></div><div>In our application, based on DPI 141(screen size: 5.7" 480X640), the application font is set as 7pt based on the below calculation where px is 14 to look the font normal.</div><div><pre class="gmail-lang-cpp gmail-s-code-block gmail-hljs" style="margin-top:0px;margin-bottom:0px;padding:12px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:1.30769;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;font-size:13px;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:5px"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit"><span class="gmail-hljs-keyword" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">double</span> pxToPt(<span class="gmail-hljs-keyword" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">double</span> px, <span class="gmail-hljs-keyword" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">double</span> dpi) {
    <span class="gmail-hljs-keyword" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">return</span> px*<span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">72</span>/dpi
}</code></pre></div><div>but the font size on target is small even though we set <span style="color:rgb(128,0,128)">QCoreApplication</span>::<span style="color:rgb(0,103,124)">setAttribute</span>(<span style="color:rgb(128,0,128)">Qt</span>::<span style="color:rgb(128,0,128)">AA_EnableHighDpiScaling</span>);</div><div><br></div><div>So if we use default font to retrieve the default font point size, it shows as 12pt which looks font size normal on display.</div><div><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit;font-size:13px">QFont f;</span></div><div><span class="gmail-hljs-keyword" style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">int</span><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit;font-size:13px"> defaultFontSize = f.pointSize();</span></div><div><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit;font-size:13px"><br></span></div><div><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit;font-size:13px">Question is if we need to use default font point size for the current reference DPI display and set </span><span style="color:rgb(128,0,128)">QCoreApplication</span>::<span style="color:rgb(0,103,124)">setAttribute</span>(<span style="color:rgb(128,0,128)">Qt</span>::<span style="color:rgb(128,0,128)">AA_EnableHighDpiScaling</span>) </div><div>so that it scales for the 8" or 10" display? Though we need to convert existing pixel size to point sizes in the application code and use layouts in some parts of code instead of setting fixed width or any hardcoded values.</div><div><br></div><div>Incase we need to show larger font, do we need to increment 4pt from the reference 12pt incase it is correct?</div><div><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit"><br></span></div><div><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit">Appreciate for your feedback in this regard.</span></div><div><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit"><br></span></div><div><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit">Best Regards,</span></div><div><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit">Ramakanth<br></span><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 8 Nov, 2020, 21:30 Thiago Macieira, <<a href="mailto:thiago.macieira@intel.com" rel="noreferrer" target="_blank">thiago.macieira@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Saturday, 7 November 2020 00:28:50 PST Ramakanth Kesireddy wrote:<br>
> Ok Thanks for your mail. Forgot to mention that Qt UI is based on<br>
> QWidgets(QPainter) with unicodes.<br>
> <br>
> Is this the reason why auto scale attribute doesn't works and need to use<br>
> QFontmetrics to set point size for the DPI accordingly?<br>
<br>
I do not understand you.<br>
<br>
What isn't working properly? Please describe without comparing to Qt 4.<br>
<br>
-- <br>
Thiago Macieira - thiago.macieira (AT) <a href="http://intel.com" rel="noreferrer noreferrer noreferrer" target="_blank">intel.com</a><br>
  Software Architect - Intel DPG Cloud Engineering<br>
<br>
<br>
<br>
_______________________________________________<br>
Interest mailing list<br>
<a href="mailto:Interest@qt-project.org" rel="noreferrer noreferrer" target="_blank">Interest@qt-project.org</a><br>
<a href="https://lists.qt-project.org/listinfo/interest" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.qt-project.org/listinfo/interest</a><br>
</blockquote></div></div></div>
</div>