domtronn / all-the-icons.el

A utility package to collect various Icon Fonts and propertize them within Emacs.
MIT License
1.46k stars 177 forks source link

Icons not aligned #77

Open troglotit opened 7 years ago

troglotit commented 7 years ago

image image

I read #33 and related commit. Tab symbol aligns but for a whole symbol πŸ˜‚. Not sure if fixable. Thought that should raise an issue in case you didn't know. Btw, I'm using Fira Code fonts

domtronn commented 7 years ago

Hey @troglotit! I have been playing around with the icon sizes and things, so it's very possible I broke it! πŸ˜…

I'll have a look into this, should be able to fix it by tweaking the values. πŸ‘

domtronn commented 7 years ago

However, could you please tell me the value tab-width inside the Neotree buffer please? πŸ™‚

troglotit commented 7 years ago
tab-width is a variable defined in β€˜C source code’.
Its value is 1
Original value was 8
Local in buffer  *NeoTree*; global value is 2
stardiviner commented 7 years ago

all-the-icons not-aligned icons I have the same issue. Check out the screenshot.

domtronn commented 7 years ago

Hmm.. I'm not sure if there's anything to be done really... Unfortunately, the problem is that some of the icon fonts aren't fixed width so it messes with alignment.

The best thing to do is use tabs as much as possible (as these line up, but getting the width of them right can be tricky) or modifying the height of the icons. You can do the latter by calling

(all-the-icons-icon-for-file "foo.txt" :height 1.2) ;; For file matching
(all-the-icons-faicon "icon-name" :height 1.2) ;; For a specific icon from a specific set

Sorry there's not really more I can do!

stardiviner commented 7 years ago

@domtronn Use property :height did fixed my problem. Thanks.

jsmestad commented 5 years ago

Is this still the most elegant solution?

stardiviner commented 5 years ago

I think yes.

wyuenho commented 5 years ago

There are quite a number of these misalignment issues. I'm considering using the SVG sources of these fonts, render the SVGs instead of using icon fonts. The trade off will be that if you've merged the icon fonts into your own font to get all-the-icons working on a term, it will stop working. You may also have to readjust some of your current alignments. If your Emacs wasn't compiled with SVG, it will also not work.

Alhadis commented 5 years ago

Anything you want me to do upstream with file-icons? Each icon was fit to a maximum aspect ratio of 1.0 (square) or narrower, for admittedly pedantic reasons that only make sense when the icons are rendered using HTML and CSS.

However, I"m beginning to regret that decision, as I've noticed file-icons being used in many environments where authors and users have no fine-grained control over icon widths, even in an HTML-based environment.

e-denny commented 4 years ago

Can the fonts be transformed so that they are made to be monospaced using something like https://github.com/cpitclaudel/monospacifier ? It's using fontforge to make the transformations.