! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
"Use system font" does not affect font size.
Status:
RESOLVED: FIXED
Product:
Mousepad
Component:
General

Comments

Description Alistair Buxton 2016-03-08 12:13:14 CET
To reproduce:

1. Open preferences.
2. Un-tick "Use system monospace font".
3. Click the font selector below.
4. Set the font size to something very big.
5. Close font selector.
6. Tick "Use system monospace font".

Expected result:

Mousepad should use the system monospace font and size.

Actual result:

Mousepad uses the custom font size instead. User cannot change it because the font selector is ghosted when the system monospace font is selected.
Comment 1 Andre Miranda editbugs 2016-04-12 18:32:25 CEST
Surprisingly I can't reproduce this bug on Mousepad 0.4.0(Antergos).
Comment 2 Rafael Giusti 2018-08-21 04:18:13 CEST
I can confirm this is reproducible using the steps from Alistair and also the following steps on Mousepad 0.4.1:

1. Open "Edit" / "Preferences"
2. Uncheck "Use system monospace font"
3. Close
4. Open "View" / "Select font..."
5. Select a different font size (also possibly a different font family)
6. Open "Edit" / "Preferences"
7. Check "Use system monospace font"

Expected and actual results are identical to Alistair's original report for Mousepad 0.4.0.
Comment 3 Anna Arad 2018-08-21 19:21:46 CEST
A quick look at the code (and a small test to confirm) shows that "use system monospace font" is actually a hardcoded font and not really the system's font.

This is a really quick fix if we want to stay with a hardcoded font and size.
But, is this the right behaviour?
Comment 4 Anna Arad 2018-08-21 19:26:35 CEST
Well, another check shows it uses the regular system font. Sorry for the mistake earlier. I compared it to the monospace font and not the regular one (because that what the text says in the preferences).
Comment 5 Anna Arad 2018-08-21 21:42:17 CEST
Created attachment 7896 
Patch for mousepad default system font

Please take a look at the patch.

It sets the hardcoded font size to 11 (if for some reason the is a problem finding the system's font).
But, it also uses the system's default monospace font correctly.
Comment 6 Anna Arad 2018-08-21 21:49:09 CEST
Created attachment 7897 
And don't forget to free resources...
Comment 7 Andre Miranda editbugs 2018-08-22 04:00:34 CEST
Looks good to me, it makes sense to read the property set by the Appearance dialog.
@Matthew, this patch introduces the dependency on xfconf, what do you think? Make it opt-out?
Comment 8 Git Bot editbugs 2018-08-22 05:05:12 CEST
Anna Arad referenced this bugreport in commit 30d3b6029995ce9ee1bb05d003ca2358471add6d

Read system font from xfconf property (Bug #12485)

https://git.xfce.org/apps/mousepad/commit?id=30d3b6029995ce9ee1bb05d003ca2358471add6d
Comment 9 Andre Miranda editbugs 2018-08-22 05:08:20 CEST
I asked Matthew on #xfce-dev, at first he would like to avoid this new dependency, but agreed to push the patch, if this dependency causes any trouble, we can always make it optional.

@Anna, I made you as the author of the commit and changed the default font size to 10, since this is the value to which MonospaceFontName defaults on reset. Thanks you!
Comment 10 Matthew Brush editbugs 2018-08-22 05:11:04 CEST
Thanks @Anna and @Andre. If the dependency causes anybody issues, we could add compile-time checking for the dependency and guard out the affected code with #ifdefs.
Comment 11 Alistair Buxton 2018-08-23 04:02:56 CEST
I reported a bug over in Ubuntu regarding monospace fonts which is related to this: https://bugs.launchpad.net/ubuntu/+source/terminator/+bug/1769774

tl;dr most of Xfce actually doesn't follow the xfconf setting and there is no cross desktop way to specify a default monospace font. Nearly all software (including most Xfce apps) either looks directly at the GNOME gsettings key or doesn't support the concept of a system default at all.
Comment 12 Andre Miranda editbugs 2018-08-23 04:43:51 CEST
At least it will work as promised/expected in Xfce, but I agree such option is awkward. Unless there is a fd.o standard for that, I don't think it's worth to worry about cross-desktop support.

Bug #12485

Reported by:
Alistair Buxton
Reported on: 2016-03-08
Last modified on: 2018-08-23

People

Assignee:
Matthew Brush
CC List:
4 users

Version

Target Milestone:
Mousepad 0.4.x

Attachments

Additional information