-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix font fallbacks #7448
Fix font fallbacks #7448
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but would you mind removing the (core)
scope from the git messages (scope should be omitted for changes to Doom's core).
d9d8709
to
4fa189e
Compare
Ah yeah, forgot about that, done. I added a bunch of issues this closes and figured we could give people some time to test and confirm, but I suppose it is easier to just merge, let them test by upgrading Doom, and reopen issues if necessary. |
4fa189e
to
eddd314
Compare
Whoops, rebased |
This fixes the issue for me. |
Edit: someone commented with some screenshots but deleted them; maybe I was right.
Dumb question, but do you have Nerd Fonts installed? Doom requires them as of #7411. If you do have them, can you attach or pastebin (do not use a code block, it pollutes issue search) your `describe-fontset` output for `fontset-default`?
|
Please see my reply in #3296 This did not fix my reported issue and broke the workaround. |
@hpfr Who is "you" in this case? |
Hi @hpfr. I've tried your PR and it improves things somewhat but not completely. I'll show below screenshots for whether I set the The PR does seem to fix the file icons to I do have trouble setting the greek and calligraphic characters with the PR. With master, setting |
@fosskers Did you see my edit? You must not use email notifications, but someone else sent several screenshots before deleting all their messages. I replied before they deleted them.
@vancleve I think that’s good news! Doom defaults |
@George9000 I don’t have enough to work with here. I don’t know your operating system or what your full configuration ( Time to bring in heavier artillery. It took a while and resulted in #7457, but I finally got a sandbox working with Doom’s mostly-baked profiles feature1. Sorry for the complicated procedure, but I need to have some confidence that issues aren’t introduced by user configuration. If you run into issues along the way, you can stop and post them here. I’m not sure how robust this is yet.
;;; profiles.el -*- mode: lisp-data; lexical-binding: t; -*-
((sandbox
;; worktree for Doom default branch
(user-emacs-directory . "~/.config/emacs-doom-upstream/")
(doom-user-dir . "~/.config/doom-sandbox/")))
;;; init.el --- Doom sandbox -*- lexical-binding: t; -*-
(doom! :completion vertico
;; :editor evil
:config (default +bindings))
;;; config.el --- Doom sandbox -*- lexical-binding: t; -*-
(load-theme 'modus-operandi t)
(setq doom-font (font-spec :family "Fira Mono" :size 12)
doom-variable-pitch-font (font-spec :family "Fira Sans"))
Footnotes |
@George9000 to start, I would just make sure your ELEMENT OF character is actually coming from JuliaMono with (load-theme 'modus-operandi t)
(setq doom-font (font-spec :family "Noto Sans Mono" :size 16)
doom-variable-pitch-font "Source Sans 3:"
doom-unicode-font (font-spec :family "JuliaMono" :size 20 :weight 'medium)) I can change the size or weight of JuliaMono, |
eddd314
to
0a97010
Compare
@hpfr Results: First, I cloned the latest doom commit to doom/info
Doom master with my configThen I followed your instructions to set up a hpfr fork with suggested configI then tried modifying your config with my fonts like this:
Last I tried appending my workaround after the lines above:
This had no effect. The most problematic glyphs are those in the first two lines: the "element of" symbol and the "ring operator" symbol used for function composition in Julia. The rendering is quite spindly or tiny using the hpfr branch and more robust on the current doom master branch.
In conclusion, I prefer the current doom master rendering over the proposed hpfr branch merge. |
0a97010
to
f78704f
Compare
Please don’t use Thanks for taking the time to debug. Based on your I added a similar variable, Please try the latest push. All you have to do is change |
Emacs Lisp doesn’t enforce constants, so I’ve dropped the breaking change verbiage for that commit. Don’t take that as license to set them! 😄 |
f78704f
to
10ec7bc
Compare
I've used the latest commit from your fork/branch. Then set fonts as directed: Result: Note the continued problem with "element of" and "ring operator" symbols. The ring operator / compose symbol is particularly bad. Even other symbols in that file seem to have better / bolder rendering in |
I get the impression you think I don’t care that this PR doesn’t work for you and have the power to merge it regardless. This is not the case. I obviously want these fixes to work for everyone and am working to ensure that they do. There are issues with Please make sure you are on latest and have disabled your workarounds. Attach or gist your I made a profile with your config. I tweaked some minor things to make it reproducible and published the fork at https://github.com/hpfr/george9000-doom/tree/repro. I’m not on macOS, but I mocked the Apple Symbols scenario by adding Noto Sans Symbols 2 to JuliaMono is taking precedence for me. @vancleve if you could get back to us with whether the latest push fixes your Apple Symbols issues, that would be greatly appreciated. That would give me some confidence that the issue is specific to @George9000 in some way. |
Mea culpa. I was using Issues resolved. Appreciate your considerable efforts to address problems raised. |
Glad to hear it. Thanks for sticking with me. I think this PR is actually ready now. A report from a Windows user would be ideal, but I think Windows should be isomorphic to macOS from the perspective of this PR (both have a fallback symbol font). Edit: one remaining question I have is whether the variable rename should actually be marked breaking. I think the alias ensures no one’s configs will break. |
Hi @hpfr! Sorry, busy at work, but coming back to emacs now :-). Thanks for all this hard work! I followed your instructions to setup the sandbox using the most recent version of the PR. Things are looking very good though there is one issue and one question with a few of the emoji I've just randomly put in this test file
describe-char: 🕳🗨🗯 |
Nerd Fonts assign icons to code points in these Unicode Private Use Areas. `doom-unicode-font` is now available again as a user-defined fallback of last resort for non-PUA Unicode code points. Ref: https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points/f12c615e4d2a411d5e9b3cc57533cf4866e6e3f2#overview
d4dec35 removed Apple Color Emoji, and it wasn’t clear how Symbola was set if this variable was nil.
No font supports all of Unicode or anywhere near it. It’s not even really possible with current font formats. Therefore, rename `doom-unicode-font` to `doom-symbol-font`. Only set it as a fallback for characters in the `symbol` and `mathematical` scripts.
This parallels doom-symbol-font for emoji. In the process, refactor symbol and emoji font setup to take advantage of these parallels.
Symbols fonts vary widely in their coverage of Unicode symbols blocks. Emoji fonts are generally guaranteed to cover the small subset of symbols code points that have assigned emoji representations, so fall back to them when symbols fonts are lacking. Ref: https://en.wikipedia.org/w/index.php?title=Variant_form_(Unicode)&oldid=1175107681#Blocks_with_standardized_variation_sequences
These are undocumented internal variables for basic platform-specific fallbacks. Now that doom-symbol-font and doom-emoji-font exist, make them constant.
1e852f6
to
df61f3b
Compare
No worries. Life takes priority. Thanks for taking another look.
Thanks, I can reproduce this. U+1F573 HOLE and U+1F5EF RIGHT ANGER BUBBLE are part of the
Yes, this is one of the complexities of Unicode. Certain code points, like U+1F5E8 LEFT SPEECH BUBBLE, existed before emoji as symbols, but also have designated emoji representations. In fact, the previous two characters that were showing up as tofu are also part of this class; it just so happens that Julia Mono only covers 🗨 of the three. Appending U+FE0{E,F} VARIATION SELECTOR 1{5,6} to the symbol code point indicates to the text renderer to prefer a {text,emoji} font. Without a selector, Unicode defines a default presentation, which is text in the case of 🗨. Many applications ignore the default, though. Try appending VARIATION SELECTOR 16 (use If you want the default representation without a variation selector to prefer emoji, Here is some reading material for anyone interested: Variation selectors are the tip of the iceberg. For more fun, try |
Wow, very informative @hpfr! Thanks again and looking forward to seeing this in |
Great work! Thanks again for your help! |
The |
See commit messages for details. Please comment if you can confirm this is an improvement, as font configuration varies from user to user and is somewhat dependent on environment and operating system. I’m fairly confident it’s good, though. To test, please remove any workarounds you may have made from your configs. Checking out my branch in your Doom installation and starting a new Emacs instance should be all you need to test. You can leave your current Emacs instance running if you have a bunch of stuff you’re working on. Just make sure to return to
master
when you’re done testing.doom-unicode-font
removes fallback fonts that support emojis #7036insert-char
#7467