Allow for easier syncing of Plasma font
AcceptedPublic

Authored by filipf on Aug 19 2019, 8:38 AM.

Details

Reviewers
ngraham
davidedmundson
Group Reviewers
Plasma
Summary

Currently the user needs to have a fonts replacment file in /.config/fontconfig/conf.d/ if they want to sync their Plasma font with SDDM.

That's not a good solution because users simply don't have this file or wouldn't know how to create it themselves.

In conjuction with https://github.com/sddm/sddm/pull/1191 this patch removes the need for additional user effort and allows for easy font syncing by writing the Plasma font value to the SDDM config file.

Test Plan

Diff Detail

Repository
R123 SDDM Configuration Panel (KCM)
Branch
easier-font-syncing (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15856
Build 15874: arc lint + arc unit
filipf created this revision.Aug 19 2019, 8:38 AM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 19 2019, 8:38 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.Aug 19 2019, 8:38 AM

We have a mixture of two things.

Here we have a serialised QFont

stored as
font=Lato,11,-1,5,50,0,0,0,0,0,Regular

using these magic methods:
QDataStream &QFont::operator<<(QDataStream &s, const QFont &font)

That tell other code how to turn a QFont object into a string and back. Including family, italics, size, etc.

In the SDDM PR we load that big text as a string, which won't go via that.

We're then using this constructor
QFont(const QString &family, int pointSize = -1, int weight = -1, bool italic = false)


Either SDDM code should deserialize the font (so that the italics and sizes and such work)
Or this code should only write the family name.

Either SDDM code should deserialize the font (so that the italics and sizes and such work)

This is much better than just setting the font family, I pushed a change in the SDDM pull request to support this now.

filipf edited the summary of this revision. (Show Details)Aug 19 2019, 12:48 PM
filipf edited the test plan for this revision. (Show Details)

Does anything bad happen if the users uses this with a version of SDDM that doesn't support it yet, or does the new item in the config file just get ignored?

Does anything bad happen if the users uses this with a version of SDDM that doesn't support it yet, or does the new item in the config file just get ignored?

Still runs for me and I'm not getting any errors when running the greeter in test mode, but I can't be 100% sure it's not causing any issues.

filipf updated this revision to Diff 64999.Fri, Aug 30, 2:24 PM

Rebase on master

ngraham accepted this revision.Fri, Aug 30, 7:13 PM
This revision is now accepted and ready to land.Fri, Aug 30, 7:13 PM

So the SDDM patch has been merged, but I don't know when the next SDDM release will be. I would keep this on hold until this happens, just to be safe... does that make sense?