Hacker News new | ask | show | jobs
by ryzawy 3337 days ago
The author claims that plugins like vim-airline are "misusing unicode characters", without an explanation. Can somebody here chime in?
4 comments

vim-airline requires you to use a patched font that replaces certain little-used unicode characters with shapes that airline uses to draw its UI. Specifically, those < and > looking dividers in the airline statusline. Although it's totally possible to use airline without this and it will look only slightly less fancy.
They're not little-used unicode characters. They're code points in the Private Use Area, which is an area of Unicode that's explicitly set aside and will never be assigned to "real" characters, specifically so they can be used for custom things. vim-airline's use of the PUA for its custom glyphs is quite appropriate, it's just annoying that it requires a patched font.

Incidentally, the Apple glyph (, or ⌥⇧K on macOS), is actually in the PUA as well (in fact, it's the very last PUA codepoint, U+F8FF). Which is why it may not render correctly in fonts that don't ship on macOS. Anyone reading this on Windows, Linux, or Android probably won't actually see the apple character.

My understanding is that the *lines are using custom glyphs for box drawing characters along with icons in the PUA. All legit use of Unicode.
The author seems to be under the impression that that set of glyphs not in the ASCII set is somehow special. That is not he case for any reasonable modern OS. Your font rendering engine does not care whether its painting a  or a F or a . As long as it knows how to draw the glyph it will, and if it doesn't it will make one up.

If your browser could not draw the tub and pantheon above chances are neither would black-screen. The author seems to be an accomplished coder, but I can't see how the magic of JavaScript will make teaching your font engine how to paint a glyph go away.

It's not the font-rendering he's taking exception to. His argument seems to be that UI elements like the chevrons and icons in vim-powerline shouldn't be rendered using fonts at all. They currently are because traditionally terminals only have text-rendering to work with, but it's clear he'd rather have that UI be HTML instead.
I suspect that the author means you should just use graphically​ drawn elements rather that special characters that sort of look like what you want. Since electron is based on a browser, you could inline images and other graphics along with the text.
Which is basically what emacs powerline does. Without using all your RAM.
As terminals are basically text-only, to display symbols that powerline uses you have to create a font containing those symbols overriding some of the characters in it.