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

Icons change to a different font when changing face properties #115

Closed
nukeop opened this issue May 18, 2018 · 20 comments
Closed

Icons change to a different font when changing face properties #115

nukeop opened this issue May 18, 2018 · 20 comments

Comments

@nukeop
Copy link

nukeop commented May 18, 2018

Suppose I have a (all-the-icons-icon-for-mode 'python-mode), which shows up as expected. I want to change its color and put it in my modeline, so I do (propertize (format " %s " all-the-icons-icon-for-mode 'python-mode)) face '(:foreground "#FFFFFF")). Now the icon changes to doxygen, which has the same hex value as python's icon, except it's in incorrect font. Why does that happen?

@seagle0128
Copy link
Contributor

Same issue here. So buggy...

@wyuenho
Copy link
Collaborator

wyuenho commented Jun 19, 2018

Which Emacs port are you using?

@seagle0128
Copy link
Contributor

I am using GNU Emacs.

@wyuenho
Copy link
Collaborator

wyuenho commented Jun 19, 2018

I mean which GUI port

@seagle0128
Copy link
Contributor

GNU Emacs 26.1 on Windows 10

@wyuenho
Copy link
Collaborator

wyuenho commented Jun 19, 2018

Try this:

  1. M-x describe-fontset
  2. Pick fontset-default
  3. isearch for #xE000

There should be a couple of other fonts listed in that block, can you paste the order of those fonts here?

@nukeop
Copy link
Author

nukeop commented Jun 19, 2018

I'm using GNU Emacs on Linux.
Here's the result for #xE000:
 ..  (#xE000 .. #xF8FF)

The left one looks like the old Mozilla logo and the one on the right is the Apple logo.

@wyuenho
Copy link
Collaborator

wyuenho commented Jun 19, 2018

Nooo I mean the fontspecs right below the range, you should see file-icons below. If not, try describe-fontset RET fontset-auto1

@nukeop
Copy link
Author

nukeop commented Jun 19, 2018

I can see this:
[-unknown-all-the-icons-normal-normal-normal-*-19-*-*-*-*-0-iso10646-1]

and some other regular fonts

@wyuenho
Copy link
Collaborator

wyuenho commented Jun 19, 2018

Then the problem you've described should no longer happen right? The reason you saw the doxygen icon was because Emacs fell back to file icons, but if you don't even see it on your fontset, you shouldn't see any file icons at all. Have you updated your font cache?

@nukeop
Copy link
Author

nukeop commented Jun 19, 2018

Apparently - yeah, I couldn't find an example of a broken symbol anymore, I'm not sure when that got fixed or why. I'm pretty sure though that it still occurs on my Thinkpad, I'll check back later.

@seagle0128
Copy link
Contributor

seagle0128 commented Jun 20, 2018

I got the list. I'm using Chinese on Windows 10.

 ..  (#xE000 .. #xF6D8)
    -outline-微软雅黑-normal-normal-normal-sans-*-150-*-*-p-*-iso10646-1
 ..  (#xF6D9 .. #xF6DB)
    -outline-Consolas-normal-normal-normal-mono-*-125-*-*-c-*-iso10646-1
 ..  (#xF6DC .. #xF8E4)
    -outline-微软雅黑-normal-normal-normal-sans-*-150-*-*-p-*-iso10646-1
 ..  (#xF8E5 .. #xF8FE)
    -outline-Consolas-normal-normal-normal-mono-*-125-*-*-c-*-iso10646-1
 .. ﹏ (#xF8FF .. #xFE4F)
    -outline-微软雅黑-normal-normal-normal-sans-*-150-*-*-p-*-iso10646-1
﹐ .. ﹯ (#xFE50 .. #xFE6F)
    -outline-Consolas-normal-normal-normal-mono-*-125-*-*-c-*-iso10646-1
ﹰ .. 𖿟 (#xFE70 .. #x16FDF)
    -outline-微软雅黑-normal-normal-normal-sans-*-150-*-*-p-*-iso10646-1
𖿠 .. 𖿿 (#x16FE0 .. #x16FFF)
    -outline-Consolas-normal-normal-normal-mono-*-125-*-*-c-*-iso10646-1
𗀀 .. 🃿 (#x17000 .. #x1F0FF)
    -outline-微软雅黑-normal-normal-normal-sans-*-150-*-*-p-*-iso10646-1
🄀 .. 🇿 (#x1F100 .. #x1F1FF)
    -outline-Consolas-normal-normal-normal-mono-*-125-*-*-c-*-iso10646-1
🈀 .. 🋿 (#x1F200 .. #x1F2FF)
    -outline-微软雅黑-normal-normal-normal-sans-*-150-*-*-p-*-iso10646-1
🌀 .. 🧿 (#x1F300 .. #x1F9FF)
    -outline-Consolas-normal-normal-normal-mono-*-125-*-*-c-*-iso10646-1
🨀 .. � (#x1FA00 .. #x10FFFF)
    -outline-微软雅黑-normal-normal-normal-sans-*-150-*-*-p-*-iso10646-1
  ..   (#x110000 .. #x17FFFF)
... (too long...)

@wyuenho
Copy link
Collaborator

wyuenho commented Jun 20, 2018

Looks like you need to install the fonts

@seagle0128
Copy link
Contributor

seagle0128 commented Jun 20, 2018

Which fonts? I've already installed all fonts from all-the-icons.

image

@wyuenho
Copy link
Collaborator

wyuenho commented Jun 20, 2018

But apparently Emacs hasn't picked up the fonts, at least not in the fontset you showed me. Check your other fontsets in Emacs, if you don't see the icon fonts in either the default fontset or auto*, you'll have to find out if there's anything changing your fontsets or you need to update the font cache in Windows or something.

@wyuenho
Copy link
Collaborator

wyuenho commented Jun 20, 2018

Also see #106

@seagle0128
Copy link
Contributor

seagle0128 commented Jun 21, 2018

I found some clues. If I enable Chinese fonts in Emacs, the issue appears. This should be the root cause.

@seagle0128
Copy link
Contributor

I figured out the root cause and fixed it. Try this (or add/remove the charsets):

      (dolist (charset '(kana han cjk-misc bopomofo gb18030))
        (set-fontset-font "fontset-default" charset "github-octicons" nil 'append)
        (set-fontset-font "fontset-default" charset "FontAwesome" nil 'append)
        (set-fontset-font "fontset-default" charset "Material Icons" nil 'append))))

@nukeop
Copy link
Author

nukeop commented Aug 6, 2018

In my case, fileicons are correct, but other icon sets, such as octicons, are broken. Icons for some modes are still broken too, for example the RJSX mode one. In some cases, the icons also change line height.

@nukeop
Copy link
Author

nukeop commented Aug 6, 2018

Another weird quirk: I can use (all-the-icons-faicon "symbol") to load an icon to display in the mode line and it shows up correctly, but after opening a buffer that uses a different icon font, the symbol changes to something else.

@wyuenho wyuenho closed this as completed Feb 18, 2019
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

3 participants