ryuslash / mode-icons

Show icons instead of mode names
http://projects.ryuslash.org/mode-icons/
159 stars 28 forks source link

Use fonts when available #4

Closed mattfidler closed 8 years ago

mattfidler commented 8 years ago

I think that you could use fonts, when they are available.

Markdown may be an example. However, I cannot get the display correct in my Emacs. @rhoit can you check if the branch works for you...

https://github.com/mattfidler/mode-icons/tree/fonts

rhoit commented 8 years ago

will check once i get home!

mattfidler commented 8 years ago

I can see the markdown symbol in the messages buffer, but not the mode-line. I know you had got the mode-line to work, so I'm thinking it may be a windows issue.

ryuslash commented 8 years ago

Perhaps also relevant?: http://fizzed.com/oss/font-mfizz

mattfidler commented 8 years ago

I agree and font awesome as well. However, I can't get it to work in windows...

mattfidler commented 8 years ago

This is what I get:

image

It shows that outside of the mode-line, the font is displayed properly. Otherwise, the font is not displayed.

mattfidler commented 8 years ago

However @rhoit shows that he got the markdown symbol to work in his screen-shot:

https://github.com/rhoit/powerline-iconic-theme

mattfidler commented 8 years ago

I can't figure out what I'm missing from his code.

ryuslash commented 8 years ago

@mattfidler: what is the value of mode-name in a markdown buffer, when you use describe-variable on it? It looks like it's using the wrong font and can't find the proper glyph in your mode-line.

mattfidler commented 8 years ago

image

The value is correct. The message is correct (when evaluating in markdown-mode), but I cannot see in the mode-line.

mattfidler commented 8 years ago

I think I have to modify mode-line-modes to get this to work...

mattfidler commented 8 years ago

I modified mode-line-modes and it didn't work. I'm assuming its a windows issue, but I would like someone to check to see if it works for them.

mattfidler commented 8 years ago

It doesn't work with cygwin-w32 either.

rhoit commented 8 years ago

kinda working in mine but background is incorrect. screenshot113

mattfidler commented 8 years ago

I think the latest will show it correctly for you @rhoit. I think it is a windows issue.

rhoit commented 8 years ago

error in after new changes.

Error during redisplay: (eval (tabbar-line)) signaled (error "Invalid image type ‘octicons’") [6 times]

P.S. I'm not sure it the error cause, I'm suspecting tabbar-ruler dependencies, will check it details later.

mattfidler commented 8 years ago

I think that was fixed in the latest push in tabbar-ruler.

I also think that not displaying is currently a windows-32 issue. If I run it in cygwin, it displays properly

image

mattfidler commented 8 years ago

I filed a bug report

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22609

ryuslash commented 8 years ago

Excellent. If it works in linux we could already add it, with proper notes in the readme.

mattfidler commented 8 years ago

It could also sort of work in windows, if the bug report response is correct.

mattfidler commented 8 years ago

I got it to work by registering the character.

image

However, only one character can be registered across all fonts. Therefore, if two modes have the same unicode code, mode-icons cannot display both fonts, just the prefered.

rhoit commented 8 years ago

Works perfectly now

screenshot97

Ignore the background its most probably due to my is due to my money-patched-theme, and dim-inactive-buffer-mode, will look at it this weekend.

mattfidler commented 8 years ago

I have updated it to work with windows. However, the icons from font don't seem to be clickable.

ryuslash commented 8 years ago

Cool!

What do you mean they're not clickable? In the mode-line? As far as I know we haven't added any click actions to it.

mattfidler commented 8 years ago

Click actions should be there. All the images (like yasnippet) bring up the major/minor mode menus. Outside of mode-icons, the text brings up the major/minor mode menus.

mattfidler commented 8 years ago

I fixed it so the text should now popup major/minor mode menus.