-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Some of the extended Unicode characters are rendered with incorrect size and placement #6738
Comments
According to Unicode 13.0, |
It occupies exactly one cell (i.e. it is narrow). But, the Notepad and other terminals render it correctly (within a single cell as demonstrated on the initial picture) opposing to the WT. |
@DHowett Actually, even the earlier releases of the WT demonstrated the correct rendering behavior. I believe it is a bug. |
fair enough |
Thanks! Coincidentally I was just talking about this exact issue elsewhere like 5 minutes ago. 😅 terminal/src/renderer/atlas/AtlasEngine.cpp Lines 1506 to 1530 in 71fc4b1
Thank you for opening another issue! I'll try to fix it... somehow. 🥲 |
@Zx-EvM That problem is specific to Nerd Fonts. Other kinds of Emojis didn't work in the previous version either. I'm working on a fix over here: #6864 (comment) |
Indeed we have determined that -- for proper support of all languages -- glyphs that extend outside the boundaries of their cells must be preserved and not shrunk. That's a very nice font you're using. The folks who made it might be willing to add a right-sized glyph for that character. :) |
What I mean is this. The glyph is effectively required in all terminal emulators to physically occupy one cell, even if the rendering shows it as taking more than one cell. We've learned a lot since this issue was originally created, but the result is the same. The glyph can be larger than a single cell (and if the font says it must be, it must be, for the aforementioned language reasons) but the text in the cells next to it also have to go in their own cells too. A terminal is strictly grid-based. A word processor is designed for proportional text, and has no requirements about cells - so Word and Notepad and every other non-grid-based editor will just nudge the characters over based on the physical rendered size of the glyph. We just don't have that luxury, because CLI applications cannot handle that. |
I see. Would it be possible to implement some customizable (per font) mapping table assigning ambiguous-width characters to desired cell widths, so the terminal handles the positioning correctly? That is: force ✽ -- 2 cells wide, ❄ -- 3 cells wide, etc. without altering the actual rendering. This way the terminal knows the actual character width and does not skew the output thinking the cell is not occupied. As the characters are ambiguous-width per the Unicode specification it is not fixable with the font itself as another application might not be cell-based and will render the output in an ugly fashion. There is an option to use some escape sequences for such purpose as an alternative. I have just found that UPD: Some more information on how |
Environment
Steps to reproduce
Some of the extended Unicode characters are rendered with incorrect size and placement (i.e. the lower-left corner of the cell). As an example the char
✽
(0xE29CBD).Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: