[Interest] Qt5 font size issue with fontconfig

Ramakanth Kesireddy rama.kesi at gmail.com
Wed Nov 11 18:24:14 CET 2020


Ok Thanks for your mail.
Yes moved to point size.

Though I set the application font in point size being 12pt(default font
point size), it doesn't adjusts accordingly across all UI screens or rest
of application. For example, the pushbutton font text appears larger.

Inorder to adjust across all the screens, do I need to set export
QT_AUTO_SCREEN_SCALE_FACTOR=1?

On Wed, 11 Nov, 2020, 21:19 Thiago Macieira, <thiago.macieira at intel.com>
wrote:

> On Tuesday, 10 November 2020 21:23:12 PST Ramakanth Kesireddy wrote:
> > Hello Thiago,
> >
> > 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.
>
> Does your system know that its screen size is 5.7"? That is, is the
> monitor
> offering the correct information to XRandR? Run the "xrandr" tool and it
> will
> tell you. Please also paste here the "Screens" section of qtdiag.
>
> > double pxToPt(double px, double dpi) {
> >     return px*72/dpi
> > }
>
> NEVER calculate font sizes in pixels. Your design is wrong. Delete this
> function and use point sizes throughout.
>
> > 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.
>
> And fix those hardcoded layouts too.
>
> > Incase we need to show larger font, do we need to increment 4pt from the
> > reference 12pt incase it is correct?
>
> You shouldn't need to. But if you have to adjust, the rest of the
> application
> should scale accordingly.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel DPG Cloud Engineering
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20201111/c5e45490/attachment.html>


More information about the Interest mailing list