Terminal font wonky
jtojnar opened this issue · comments
Actually, when I choose a font manually in Sunflower’s Terminal preferences and click save, it does not get applied because it raises an error:
Traceback (most recent call last):
File "/nix/store/njsi0vygq275igv5ns2qsjp3hxavbc5r-sunflower-2020-07-16-unstable/lib/python3.8/site-packages/sunflower/gui/preferences_window.py", line 193, in _save_options
self._parent.apply_settings()
File "/nix/store/njsi0vygq275igv5ns2qsjp3hxavbc5r-sunflower-2020-07-16-unstable/lib/python3.8/site-packages/sunflower/gui/main_window.py", line 2174, in apply_settings
page.apply_settings()
File "/nix/store/njsi0vygq275igv5ns2qsjp3hxavbc5r-sunflower-2020-07-16-unstable/lib/python3.8/site-packages/sunflower/plugin_base/terminal.py", line 351, in apply_settings
self._terminal.set_font_from_string(section.get('font'))
AttributeError: 'Terminal' object has no attribute 'set_font_from_string'
But after I restart it, it picks up the change:
Maybe the issue is that the system setting is missing Regular. But GNOME Terminal seems to handle that.
These are two separate issues.
That said, I am getting font from org.gnome.desktop.interface.monospace-font-name
. So this issue shouldn't really happen with weird font. The other issue where it's calling unknown method I just fished and pushed fix for. Can you retest?
Yes, that fixes the secondary issue. Thanks.
Hmm, if I set the font manually, it still gets stored as Monospace 11
in the config – exactly the same what settings.get_string('monospace-font-name')
returns, so the Regular
variant is only in the font chooser.
So I do not understand why use_system_font
is wonky but setting the same font manually works.
Yeah, gsettings-desktop-schemas
use Source Code Pro 10
as the default monospace font but it is not installed on Ubuntu, which overrides the value to Monospace 11
.
In Nixpkgs, we wrap programs to use upstream schemas in case they are not installed globally on the system so my Sunflower package on Ubuntu tried to use the default value from the upstream schemas and failed.
Glad to hear you found the source of this issue. Thanks for reporting them!