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

Change font on popups #577

Open
krstp opened this issue May 26, 2023 · 5 comments
Open

Change font on popups #577

krstp opened this issue May 26, 2023 · 5 comments

Comments

@krstp
Copy link

krstp commented May 26, 2023

I would like to have an option to change the font on the inline blame popups as well as on the window popups. I tried to toy with the css popup stylesheet file, but no success :(

In particular what is annoying, for some reason it picks up by default a Times font, which definitely is not my prime choice:
inline

I would like to be able to change the font to my liking.

@deathaxe
Copy link
Collaborator

"Blame" uses ST's annotation API. GitGutter doesn't assign explicit font-family settings to it. The font is choosen by ST or any CSS embedded in the active color scheme.

By default ST should pick the font from preferences. I already saw Times New Roman being applied, too, but never found out the root cause.

Font name is a global setting, which would effect any plugin using annotations api. Hence it doesn't make sense to introduce a font-family setting to adjust it for GitGutter only.

Diff popup also uses a view's font to display diffs. Font is set only for toolbar glyphs. Diff popup can be modified via Preferences: GitGutter Popup Stylesheet.

I am able to adjust "diff" fonts via:

/* GitGutter Popup Stylesheet - User */

.git-gutter div.highlight {
    font-family: Arial;
}

It not working on your end, may be caused by the same reason for Times New Roman being selected for annotations.

@krstp
Copy link
Author

krstp commented May 26, 2023

So here is an interesting thing...
I can change global font in the settings via user preferences:

{
    "font_face": "MesloLGS NF",
//  "font_face": "agave NF",
}

which will pick up the desired font and change it globally, but inline/popups will NOT accept it as if it cannot find the font (which seems to be consistent with other posts on the web having similar issue). Note, all the fonts are instanced in custom font Mac path, so should be visible.

When I comment the the line out // then of course Sublime picks up the default font (whatever it is), and here the inline/poups appear to be catching the same global font without "Times-ing" it, but it just means I cannot use the custom font 🤔

So I am kind of clueless why would custom font work globally except popups and inline 🤔 As if ST is not picking up the new custom-default font.

@krstp
Copy link
Author

krstp commented May 26, 2023

Yeah, and I did try diff options for GitGutter and I do not see any relevant changes :(

@deathaxe
Copy link
Collaborator

That's however nothing related to GitGutter.

Maybe another package or color scheme messes around with font-family property in global manner, preventing ST from applying its defaults (global font_face). Proposed font-family changes of popup dialog not being picked up is a rather reliable indicator for that happening. So there's nothing GitGutter could do to work around that.

ST has known limitations with regards to correctly cascade multiple stylesheets or picking up changes from color_scheme's CSS settings.

Related core issues are:

Notes:

All popups/annotations pick up correct fonts on my machine.

Diff Popups are rendered by mdpopups library.

@krstp
Copy link
Author

krstp commented May 28, 2023

Without in-depth testing, this is the assumption and wild guess I make, so thanks for verifying. When I have a minute I might look more into it, for now I guess the default font is fine for me. Thanks for following up 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants