Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default text color is too dark on vte-terminal #342

Closed
tliron opened this issue Jan 3, 2019 · 32 comments
Closed

Default text color is too dark on vte-terminal #342

tliron opened this issue Jan 3, 2019 · 32 comments

Comments

@tliron
Copy link

tliron commented Jan 3, 2019

Is there a way to avoid the bold font in the terminal? (I'm using Tilix, specifically)

It seems there is no way to change this within terminals, because they inherit the font selection from the theme. It would be great if there were a configuration option to avoid this.

@actionless
Copy link
Collaborator

i am not aware of tilix specifically but gnome-terminal for instance have it in it's own configuration

i guess you need to contact tilix developers on this

@tliron
Copy link
Author

tliron commented Jan 3, 2019

Actually, looking closely it is not just Tilix, and it's not exactly bold. I just noticed it most there. It seems that everywhere Materia causes fonts to be heavier. Do you know what causes this? Switching to a theme like Arc makes the issue disappear immediately.

@actionless
Copy link
Collaborator

actionless commented Jan 3, 2019

try adding to your ~/.config/gtk-3.0/gtk.css:

* {
  text-shadow: none;
  font-weight: normal;
}

(Materia is using font-weight 500 instead of 400)

@tliron
Copy link
Author

tliron commented Jan 4, 2019

This had no effect (I restarted GNOME Shell). Is there somewhere in the Materia theme CSS that I can change the weight?

@actionless
Copy link
Collaborator

you can try doing it in some particular application using GtkInspector's CSS tab

@nana-4
Copy link
Owner

nana-4 commented Jan 6, 2019

@tliron Is that only in the terminal apps? Could you attach screenshot(s) to know exactly which/where font you are talking about?

Actually, looking closely it is not just Tilix, and it's not exactly bold. I just noticed it most there. It seems that everywhere Materia causes fonts to be heavier. Do you know what causes this?

If you are talking about buttons or tabs, it is intentional as in Material Design medium font weight (500) is used for them. See:

Is there somewhere in the Materia theme CSS that I can change the weight?

Please search font-weight: 500; and try removing those lines.

@tliron
Copy link
Author

tliron commented Jan 15, 2019

Thank you for your detailed response! I tried commenting out those lines (from gtk-3.0/gtk.css), but the problem remains. I also tried debugging with GtkInspector, but I could not find any property anywhere that would cause this effect. Very confusing! I'm attaching two images (Adwaita and Materia) to show you what's happening.

materia-off
materia-on

@actionless
Copy link
Collaborator

actionless commented Jan 15, 2019

the only difference i see is what on Materia screenshot text is slightly darker

@tliron
Copy link
Author

tliron commented Jan 15, 2019

The end effect is darker, but if you look closely it's either due to added weight or some change in anti-aliasing. It might seem subtle, but in everyday work it does make Materia unusable for me. I would be happy to patch it myself, but first we need to figure out what is causing this. Removing the font-weight css did not change this.

Do you have some ideas that I can add as css overrides to GtkInspector to try it out?

@actionless
Copy link
Collaborator

actionless commented Jan 15, 2019

try lighter fg color

font rendering indeed could happen slightly different in depend of color

@tliron
Copy link
Author

tliron commented Jan 15, 2019

Can you explain what you mean? Where would I change that in css?

@actionless
Copy link
Collaborator

for just testing purpose you can set it globally:

* {
color: #999999;
}

@tliron
Copy link
Author

tliron commented Jan 15, 2019

This changes the colors for most things ... but not the terminal font. It seems that terminal font css comes from somewhere else. Actually you can try it yourself in GNOME terminal (Tilix uses the same VT widget).

@actionless
Copy link
Collaborator

anyway just for testing purpose could you override the foreground color in terminal preferences?

@tliron
Copy link
Author

tliron commented Jan 15, 2019

Overriding seems to work. But it seems that the defaults are somehow different in Materia as compared to other GTK themes.

@actionless
Copy link
Collaborator

just to clear it up, after changing font color "font rendering" problem got fixed?

@actionless
Copy link
Collaborator

if not please show the screenshots with the same fg/bg colors but different themes

@tliron
Copy link
Author

tliron commented Jan 15, 2019

If I set Tilix to use the internal color scheme, it is consistent across all GTK themes. But if I set Tilix to use "Use theme colors for foreground/background", then the problem appears. By the way, the Materia CSS does include some custom theming for Tilix.

@actionless
Copy link
Collaborator

by "problem" you mean what Materia is not using your favorite color as terminal foreground?

@actionless
Copy link
Collaborator

actionless commented Jan 15, 2019

custom theming for Tilix

@nana-4 btw what do you think about generating some terminal themes for Materia users? now you can just set terminal colors in Modern -> Materia preset and export them via Base16 for tilix, gnome-terminal and others:

2019-01-15--1547580701_1920x1080_scrot

(currently Materia* themes there are just using fallback auto-generated terminal palette which looks quite off from the material design)

@tliron
Copy link
Author

tliron commented Jan 15, 2019

By "problem" I mean the issue you can see in my attached photos above, which now we realize is probably due to a wrong "black" color.

There's no need to create a special theme for Tilix: actually, it already includes a material theme and there are many community themes. However ... the included material theme is dark, and I personally prefer my terminal to match the desktop theme (I use the default Materia, which is light). So I always have "Use theme colors for foreground/background" set and I'm usually happy with whatever GTK theme I use ... except Materia which has this issue. :)

@actionless
Copy link
Collaborator

by "problem" you mean what Materia is not using your favorite color as terminal foreground?

wrong "black" color.

that sounds like "yes" answer to the question above

@tliron
Copy link
Author

tliron commented Jan 15, 2019

Well, you asked about "favorite" -- specifically we are talking about the terminal inheriting the GTK theme. It's not always my favorite, but it is matching. :)

@actionless
Copy link
Collaborator

do you mean in Materia TextView and Terminal colors are not matching?

@nana-4
Copy link
Owner

nana-4 commented Jan 15, 2019

Ah, I got it. It seems the terminal screen (VT widget?) don't understand or ignore the text alpha value.

Materia uses rgba(0, 0, 0, 0.87) as primary dark text color, so the text color is supposed to be displayed like #212121 on white background in RGB. However, in reality the text is displayed in #000000 (pure black) on that terminal screen.

This problem should really be fixed upstream, but I'll add a workaround for this. Thanks for your report.

@nana-4
Copy link
Owner

nana-4 commented Jan 15, 2019

@actionless

@nana-4 btw what do you think about generating some terminal themes for Materia users?

I think it's better to talk about it in #157, but I will keep that in mind. Thanks for the suggestion.

@nana-4 nana-4 changed the title How to avoid bold font in terminal Default text color is too dark on vte-terminal Jan 15, 2019
@tliron
Copy link
Author

tliron commented Jan 15, 2019

Thanks @nana-4, I would be happy to help test. I'll subscribe to #157. Thanks also @actionless for your assistance!

@tliron
Copy link
Author

tliron commented Jan 16, 2019

For what it's worth, I found the base16 Tilix themes to have quite a few that are a good match for Materia. There is even a theme called "Materia", though I don't think it's related to this project.

@actionless
Copy link
Collaborator

actionless commented Jan 16, 2019

@tliron to learn how to use those templates see this tutorial: https://gist.github.com/actionless/f9ad9e5ab9eac414dac8a3392beb3ad5

just at the last step choose tilix instead of alacritty

@tliron
Copy link
Author

tliron commented Jan 16, 2019

@actionless Thanks, there are quite a lot of themes already included in the repo linked above.

@actionless
Copy link
Collaborator

yeah, but you mentioned what you prefer light themes, and it's easier to swap light/dark colors from the UI

@nana-4
Copy link
Owner

nana-4 commented Feb 4, 2019

So sorry for my delay in responding.

My guess was wrong. At first I thought adding this will work:

vte-terminal { color: rgba(0, 0, 0, 0.87); }

In fact, however, VTE's text color is hard-coded with @theme_fg_color. That means, it won't be changed unless we change the color of that variable. But for some reasons I don't want do that in this theme.

So, please manually edit the theme color variable (from rgba(0, 0, 0, 0.87) to #212121, for example), or report to the upstream that RGBA text color doesn't work.

I'm gonna close this as an upstream issue.

@nana-4 nana-4 added wontfix and removed enhancement labels Feb 4, 2019
@nana-4 nana-4 closed this as completed Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants