-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support PowerLine triangle and diagonal line glyphs #4258
Comments
Wow this is getting tedious, its like writing a custom font for xterm.js in the end. Btw there are more unicode parts, that will need babysitting like that - like the new teletext codepoints for 3x2 blocks. |
We're not covering everything though, just ones that are easy to draw in a canvas. The result is pretty great:
You mean these ones? https://en.wikipedia.org/wiki/Teletext_character_set#Graphics_character_sets I haven't heard about them before so I don't think we'd bother there. Powerline symbols however are used extensively in a terminal. |
Here's what it looks like when rendered using Cascadia Code PL: Verified in microsoft/vscode#163000 (comment) to be |
Yep. They not commonly used yet, as they got specced pretty recently (like in current or prev unicode version). |
This also fixes an issue with padding making glyphs regress Fixes xtermjs#4258
With this I went with single width glyphs, it seems that the original powerline extra symbols used double width but a lot of fonts also use single. |
@Tyriar Imho the powerline glyph and their correct proportions by fonts using them is just broken (or more diplomatic - underspecced). The fact that most fonts propagate them as single width looks wrong to me, and led to that ugly hack by several prompt scripts with additional SPs after those powerline chars. AS I said in some other thread comment (idk where it was) - the PUA region is left unspecced on purpose, if someone wants to fill that gap (powerline does here), they have to provide a proper spec. xterm.js on the other hand would have to load that PUA spec and deal with these codepoints accordingly. Thats how it is intended from unicode side and respected by several other PUA overloads. The SP hack introduced by prompt scripts is wrong and should be banned. Well it is as it is atm, but this hand-waving state with powerline glyphs will just drop on our feet again and again, until the whole "powerline comunity" will fix the spec and SP issue. |
@jerch there have been very few complaints since we shipped this and prompts look great with the custom rendering, the only ones that come to mind are minor unintended regressions. Sure an actual spec would be great but I don't think it's that big of an issue atm. The worst that could happen is they can disable custom glyphs and go back to the terrible regular rendering, or request more fine grained tuning of the custom glyph setting. |
@Tyriar Sure thing - as long as it works okish - "dont change a running system". Its just sad, that specs get watered more and more intentionally by ignoring basic ideas. Also not the nerdfont guys are to be blamed here, they clearly state somewhere, that their glyphs are intended as wide (even their font patching generator sets them to wide by default). So basically all font maintainers delivering powerline things as half width override the default setting on purpose. Geez. 😪 |
Well both https://github.com/ryanoasis/powerline-extra-symbols and https://github.com/ryanoasis/nerd-fonts show wide, should we change it to wide? It's quite an easy change on our end, at least the rendering of them, changing the actual width of the character might cause some problems? |
Really can't say which route is better one atm. If we switch to wide by default, we might get issues then from broken prompt scripts always emitting the SP hack. (Or even have to place some sanity code in the renderer to detect that condition and to skip the superfluous filler SP on purpose). |
VS Code issue showing bad rendering when rendering the glyph from the font: microsoft/vscode#163000
We should support custom rendering of
e0b8
throughe0bf
powerline symbols:Code pointer:
xterm.js/src/browser/renderer/shared/CustomGlyphs.ts
Lines 346 to 374 in f381783
The text was updated successfully, but these errors were encountered: