Re: How is the Font DPI Scale stored?

2019-06-16 Thread Thiago Macieira
On Wednesday, 12 June 2019 08:53:50 PDT Elias Mårtenson wrote:
> Thank you. That works beautifully. I do wonder, however, if it's
> deprecated, what is meant to replace it?

Properly? Wayland.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products





Re: How is the Font DPI Scale stored?

2019-06-12 Thread Nate Graham

On 6/12/19 9:53 AM, Elias Mårtenson wrote:
On Wed, 12 Jun 2019 at 17:27, Christoph Feck > wrote:


https://wiki.archlinux.org/index.php/Font_configuration says:

$ xrdb -query | grep dpi
Xft.dpi:        144

You can read XResources via libxcb calls, code in Qt is here:

https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/xcb/qxcbscreen.cpp#n357

Note that this value is deprecated, because it isn't per-screen.


Thank you. That works beautifully. I do wonder, however, if it's 
deprecated, what is meant to replace it?


Qt Scaling in the KScreen KCM (System Settings > Display & Monitor > 
Displays > Scale Display)


Nate




Re: How is the Font DPI Scale stored?

2019-06-12 Thread Elias Mårtenson
On Wed, 12 Jun 2019 at 17:27, Christoph Feck  wrote:


> https://wiki.archlinux.org/index.php/Font_configuration says:
>
> $ xrdb -query | grep dpi
> Xft.dpi:144
>
> You can read XResources via libxcb calls, code in Qt is here:
>
> https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/xcb/qxcbscreen.cpp#n357
>
> Note that this value is deprecated, because it isn't per-screen.
>

Thank you. That works beautifully. I do wonder, however, if it's
deprecated, what is meant to replace it?

Regards,
Elias


Re: How is the Font DPI Scale stored?

2019-06-12 Thread Christoph Feck

On 06/12/19 08:01, Elias Mårtenson wrote:

I am a developer for the McCLIM  graphics
toolkit, and I would like it to be able to integrate better with KDE.

Currently, McCLIm has a hardcoded font scale which is problematic when on a
high DPI screen. It's possible for a user to customise it but recomputing
the default fonts, but that's not ideal.

What I'd like to do is to read the KDE "Force Fonts DPI" setting, and use
it to automatically compute the new font sizes. However, it's unclear to me
how this value is propagated to applications. There must be a standard for
this, since a lot of applications is able to pick it up, but I haven't been
able to figure it out.

What is the proper way to read this value?


https://wiki.archlinux.org/index.php/Font_configuration says:

$ xrdb -query | grep dpi
Xft.dpi:144

You can read XResources via libxcb calls, code in Qt is here:
https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/xcb/qxcbscreen.cpp#n357

Note that this value is deprecated, because it isn't per-screen.

--
Christoph Feck



Re: How is the Font DPI Scale stored?

2019-06-12 Thread Boudewijn Rempt
On woensdag 12 juni 2019 08:01:19 CEST Elias Mårtenson wrote:
> I am a developer for the McCLIM  graphics
> toolkit, and I would like it to be able to integrate better with KDE.
> 
> Currently, McCLIm has a hardcoded font scale which is problematic when on a
> high DPI screen. It's possible for a user to customise it but recomputing
> the default fonts, but that's not ideal.
> 
> What I'd like to do is to read the KDE "Force Fonts DPI" setting, and use
> it to automatically compute the new font sizes. However, it's unclear to me
> how this value is propagated to applications. There must be a standard for
> this, since a lot of applications is able to pick it up, but I haven't been
> able to figure it out.
> 
> What is the proper way to read this value?

The proper way to support HiDPI is not by messing with font sizes. You set the 
hidpi flag:

 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

Before you create your QApplication instance, and you make sure pixmaps are 
available in normal 2x sizes. HiDPI support in Qt isn't that great, though, 
fractional scaling doesn't work and there are moments when Qt gets really 
confused and thinks it needs to scale up when it shouldn't.

See https://doc.qt.io/qt-5/highdpi.html

-- 
https://www.valdyas.org | https://www.krita.org




How is the Font DPI Scale stored?

2019-06-11 Thread Elias Mårtenson
I am a developer for the McCLIM  graphics
toolkit, and I would like it to be able to integrate better with KDE.

Currently, McCLIm has a hardcoded font scale which is problematic when on a
high DPI screen. It's possible for a user to customise it but recomputing
the default fonts, but that's not ideal.

What I'd like to do is to read the KDE "Force Fonts DPI" setting, and use
it to automatically compute the new font sizes. However, it's unclear to me
how this value is propagated to applications. There must be a standard for
this, since a lot of applications is able to pick it up, but I haven't been
able to figure it out.

What is the proper way to read this value?

Regards,
Elias