Modify kcm fontconfig to get independent subpixel and hintstyle options
AbandonedPublic

Authored by kurmikon on May 4 2020, 5:19 PM.

Details

Reviewers
bport
Group Reviewers
Plasma
Summary

Now kcm fontconfig has subpixel rendering and hintstyle options depending on antialiasing. This means if I disable antialiasing, I can't set the other two options.

As far as I know, subpixel rendering and hintstyle don't depend on antialiasing and fontconfig does not prevent to set them when antialiasing is off. Indeed the previous version of kcm fontconfig had a different behavior, letting the user chose their values whether antialiasing was enabled or not. So I suggest to always enable them.

Then I'd like to get a clarification on DPI value. Reading the code I see that the spinbox accepts values from 24 with stepsize of 24.

QtControls.SpinBox {
                    id: dpiSpinBox
                    stepSize: 24
                    editable: true
                    enabled: dpiCheckBox.checked
                    value: kcm.fontsAASettings.dpi !== 0 ? kcm.fontsAASettings.dpi : 96
                    onValueModified: kcm.fontsAASettings.dpi = value
                    // to: need to divide to stepSize
                    to: 1008
                    // lowest vaue here can be == stepSize, that is because 0 means off
                    from: 24
                }

That seems weird to me. First of all, the user don't even know the spinbox accept only values multiple of 24. If it were this way, there should be a message to inform the user. But basing on information reported here, neither xdpyinfo, xrdb and fontconfig report values multiple of 24.

In example, xorg wrongly assumed that my monitor had 96 as DPI value, but I calculated it properly and the real value is 101 (see here how to do it). So I expect system settings to accept 101, but since stepsize is 24, it seems I can't set it. The comment in the section of code posted above says to divide by 24, but I can't understand why.

Maybe was this intended to format the value before it is passed to the system functions? If so, this should be done after the user wrote the value.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Lint Skipped
Unit
Unit Tests Skipped
kurmikon created this revision.May 4 2020, 5:19 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 4 2020, 5:19 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kurmikon requested review of this revision.May 4 2020, 5:19 PM
kurmikon edited the summary of this revision. (Show Details)May 4 2020, 5:39 PM

How does subpixel hinting work without anti-aliasing?

I don't know the reason behind limiting the font DPI spinbox to multiples of 24, but that question should be asked elsewhere, not in the description section of a patch, which will become a commit message if this patch lands.

kcms/fonts/package/contents/ui/main.qml
219

true is the default value; no need to set this at all then

256

ditto

How does subpixel hinting work without anti-aliasing?

Good question. I thought they were independent because fontconfig has an hinting option that can be set true or false in addition to hintstyle. But I'm doing some tests now and they are related. So, hinting does not work with antialiasing off, then I worder what's the meaning of hinting, since I noticed that enabling or disabling it with antialiasing on is identical. But that's a matter of fontconfig.

I don't know the reason behind limiting the font DPI spinbox to multiples of 24, but that question should be asked elsewhere, not in the description section of a patch, which will become a commit message if this patch lands.

You're right, I'm sorry. Please, close this revision and I will make a new one to modify stepsize to 1.

No worries!

You have to abandon it: Add Action...Abandon Revision

kurmikon abandoned this revision.May 4 2020, 8:03 PM

No changes needed.