MeanEYE / Sunflower

Small and highly customizable twin-panel file manager for Linux with support for plugins.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terminal font wonky

jtojnar opened this issue · comments

Are you doing anything special to the terminal font? It looks misaligned for me compared to GNOME Terminal:

Screenshot from 2020-10-03 17-15-02
Screenshot from 2020-10-03 17-15-31

I am using the default font:

Screenshot from 2020-10-03 17-22-39

And actually even when I choose a different font manually nothing changes.

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:

image

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.

Hmm, it is probably my mistake. If I manually change it to the same value as default it works:

Screenshot from 2020-10-03 18-05-22

Most likely caused by an incompatible override I have. Sorry for the noise.

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!