jnsh / arc-theme

A flat theme with transparent elements (actively maintained fork)
GNU General Public License v3.0
902 stars 77 forks source link

Fonts too large in GNOME Shell #77

Closed volsa closed 3 years ago

volsa commented 4 years ago

Typing this from a fresh Arch Linux installation I was wondering if you guys intentionally increased the height of the top bar, as it seems bigger than what I can remember. For reference here's a GIF output

antonvalletas commented 4 years ago

I just came here with that exact same feeling. The package in arch repos arc-gtk-theme just gut updated, and instantly after rebooting I was feeling the top bar in gnome shell was way bigger than it used to.

EDIT: Its not just the top bar, but also all the menus associated with it, they all seem bigger wider and taller.

EDIT2: Seems related to https://github.com/jnsh/arc-theme/commit/e672981af6dff3e7896310aa8118ff01624a9538 which is included in the latest release.

EDIT3: While 3.36 lets users pick their favorite Font Family, and gnome-shell will respect it, what the shell doesn't respect is the chosen font size. This is why, when increasing font size from 9 to 11 in that commit, everything feels bigger, even if I choose a smaller font size. I think the correct thing would be to revert that commit until gnome-shell developers choose to respect the users font size, as most people who used Arc theme, probably like a font smaller than 11pt

brneor commented 4 years ago

The small font size on Gnome Shell was so nice!

jnsh commented 4 years ago

There hasn't been changes to the size of the top bar or other elements, but the larger font-size indeed increases their size.

The font size has been discussed ad nauseam, and there's no perfect solutions since users have different preferences.

However, you can adjust the GNOME Shell font size exactly to your liking either by

The 11pt default font size was chosen based on the following:

This issue can remain open for now as I'd imagine others are looking for answer for this as well, but eventually this will be closed as WONTFIX. Any suggestions for improving this situation that haven't been brought up yet in earlier discussions are naturally appreciated.

EDIT: Updated the title on the first post to make this easier to find for people looking for a solution.

antonvalletas commented 4 years ago

Just as an FYI, if someone wants to change the font size easily, you can edit /usr/share/themes/themename/gnome-shell/gnome-shell.css and edit $font-size to your desire. After that restart or switch shell theme again.

brneor commented 4 years ago

Just as an FYI, if someone wants to change the font size easily, you can edit /usr/share/themes/themename/gnome-shell/gnome-shell.css and edit $font-size to your desire. After that restart or switch shell theme again.

Although this seems the easy way, is worth mentioning this fix is temporary and will be reverted every time your system updates the package. The right way to do it is compiling your own copy of the source code. Is not that hard and you'll avoid future issues.

volsa commented 4 years ago

But worry not for Pacman hooks are here for you! Anyways, if you're on Arch Linux you could use hooks https://wiki.archlinux.org/index.php/pacman#Hooks. A very simplistic hook might look like this:

[Trigger]
Type = Package
Operation = Upgrade
Target = arc-solid-gtk-theme

[Action]
Description = Adjusting arc-solid-gtk-theme font size
When = PostTransaction
Exec = /usr/bin/sed -i 's/font-size: 11pt;/font-size: 10pt;/1' /usr/share/themes/Arc-Dark-solid/gnome-shell/gnome-shell.css

Save the snippet as arc-solid-gtk-theme.hook (or whatever you like) inside /usr/share/libalpm/hooks. This will simply replace the first occurrence of font-size: 11pt whenever arc-solid-gtk-theme is updated.

Edit: @jnsh FYI the suggested solution (adjusting the text-scaling-factor) doesn't work for all applications. The menu bar of electron based application for example will ignore text-scaling.

jnsh commented 4 years ago

Editing the single CSS rule in gnome-shell.css is not a proper way to change the font size, as it won't adjust the font-size across the whole theme. You should edit the value for $font-size variable in _common.scss before compilation as instructed above. This can't be done to the compiled gnome-shell.css file, and the SCSS variable doesn't even exist in it.

Of course you're free to do whatever works for you, but I want to be clear this isn't a complete fix, and really wouldn't want it to advertised as a working solution here. Generally, if you don't know what you're doing by editing the code, you shouldn't do it.

Personally I'm recommending changing the font size by adjusting the text-scaling-factor. That's what I'm doing myself, and I haven't noticed any issues resulting from it.

@jnsh FYI the suggested solution (adjusting the text-scaling-factor) doesn't work for all applications. The menu bar of electron based application for example will ignore text-scaling.

Thanks for letting me know. As I said above, I haven't noticed issues myself, but then again I'm not using any electron based applications either. At least GTK and QT based application seem to work as expected with the scaling. It's unfortunate if some toolkit doesn't apply the scaling, but I don't think there's anything that could be done from the theme's side.

Also, If you're using Arch and want to change the font-size within the code, instead of using hooks, you should edit the PKGBUILD before building it yourself, and use e.g. sed or patch to change the $font-size in [prepare()](https://wiki.archlinux.org/index.php/Creating_packages#prepare()).

EDIT. e.g. the following (untested) snipplet should work in arc-gtk-theme-git, adjust to your preference:

prepare() {
  cd "${_pkgname}"
  sed -i 's/$font-size: 11;/$font-size: 11;/g' common/gnome-shell/"${_gnomeshellver}"/sass/_common.scss
}
andersjohansson commented 4 years ago

Editing the single CSS rule in gnome-shell.css is not a proper way to change the font size, as it won't adjust the font-size across the whole theme.

You are completely right of course. But this “solved” the problem with a too large font in the top bar (the primary use I have for the gnome-shell). I want the top bar slim. All other elements use good font sizes from the settings. Using text-scaling-factor was also difficult to use for this purpose since I use it for toggling font-sizes between my internal laptop screen and external screen (as fractional scaling of resolution doesn’t work so well yet).

I will use @sagcan’s pacman hook and be satisfied with that for now.

Thank you for your work on maintaining Arc! The decision to increase the font-size is right, it’s just the lack of configurability of the gnome-shell font size that’s a problem.

intrnl commented 3 years ago

Might be a necrobump, but it seems that making the font-size smaller results in larger app icons in the overview grid?

jnsh commented 3 years ago

Might be a necrobump, but it seems that making the font-size smaller results in larger app icons in the overview grid?

Sorry, but I really don't see how that could be possible. Would you mind sharing before/after screenshots, and explain how you reduced the font-size?

intrnl commented 3 years ago
Before After

I changed the font-size via the $font-size variable as mentioned here

jnsh commented 3 years ago

Thanks for the screenshots. I think this happens because gnome-shell adjusts the icon size based on available screen space, i.e. the icons are scaled down on smaller resolution screens. When you reduce the font-size there's more space available for the icons, and they are therefore drawn in larger size.

This doesn't seem to happen if you adjust the font size via the font scaling factor setting from gnome-tweaks. I'd also imagine this wouldn't happen on larger resolution screens, where the icon size is already maxed out.

I'm not sure whether there could be any good and simple solution for avoiding this from the theme's side. You could try increasing the spacing values for .icon-grid here, or padding for %icon_tile here, to keep the icons smaller.

Unfortunately as long as there's no proper upstream support for adjusting the shell font size, all the available solutions are kinda hacky, and may result in annoying side effects :/

intrnl commented 3 years ago

Ahh okay, it is a shame 😅

jnsh commented 3 years ago

Closing as I added explanation of the workaround in wiki, and there probably isn't anything more to discuss. The shell font situation is what it is..

It should be possible to add a meson build option for setting the font size, which could be helpful as well. I may look at implementing it at some point, but it's not the highest priority task at this time.