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

Fallback font resolution behavior is different from (most?) other macOS apps #886

Closed
tlindsay opened this issue Nov 15, 2023 · 2 comments · Fixed by #1204
Closed

Fallback font resolution behavior is different from (most?) other macOS apps #886

tlindsay opened this issue Nov 15, 2023 · 2 comments · Fixed by #1204
Labels

Comments

@tlindsay
Copy link
Collaborator

tlindsay commented Nov 15, 2023

I use patched FantasqueSansMono installed via homebrew. The codepoint that I use for my "unsaved changes" indicator in Neovim is:

⧆ U+29C6 ⧆ SQUARED ASTERISK (Sm) https://unicode-table.com/en/29C6/

That codepoint is not defined by my font. In most (all?) other apps on my system, "Apple Symbols" is the fallback font, but Ghostty falls back to "STIX Two Math".

The Fantasque font lacks support for many codepoints in non-continuous ranges, making the current implementation of font-codepoint-map an imperfect solution.

@mitchellh mentioned in Discord that there is some ambiguity in how macOS reports fonts and that there may not be an authoritatively Correct™ way to handle this.

A potential solution would be to allow users to define a font-family-with-fallback, similar to how WezTerm handles this problem.

Relevant Discord Thread

@mitchellh
Copy link
Contributor

I'm going to say this is fixed by #1196. I'm open to tweaking the Apple font search more but I think given the sample size of people this has affected is n=1 right now and you said yourself that fallback specification would fix this, let's call this good.

@ilyagr
Copy link

ilyagr commented Jan 4, 2025

For me, the main problem with the STIX font is that it is not aligned correctly with a monospace font. Here is a piece of my shell prompt; the blue character comes from STIX and is too far to the right.

Image

Here are some symbols that get taken from STIX and have this problem: ⏵⏱⏲⏸. The other characters come from Ghostty's default font, the size doesn't seem to matter. (I also use font-feature = -calt). I'm using Mac OS Sonoma on ARM and Ghostty 1.0.1.

I'm not sure what the best solution is, but if Ghostty could somehow move and align the character properly, that'd solve the problem for me. Another possible solution would be for Ghostty to treat these symbols as "wide" rather than "narrow" (though I think this would require thinking about the spacing as well, just adding a space after that symbol currently does not look good).

Loosely related: The Apple Emoji font has overly complicated designs for this and similar symbols IMO, so I wouldn't want to use it for this purpose. Another font that has a decent rendering of these symbols is "Noto Symbols 2". Nerd fonts (incl. "Symbols Nerd Font Mono") might be a good choice.

Update: I didn't think this is related to #4504, but I do have a HiDPI setup as described in #4162 (comment)

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

Successfully merging a pull request may close this issue.

3 participants