Emojis render with trailing spaces within Boxes
See original GitHub issueHi there! First time using ink, and I’m really enjoying it so far, but I’ve run into a snag for my project.
I’m making a small terminal-based board game and want to display emojis inside Box elements, but as the title says, every time I render a Box containing a Text element with emojis inside, any row containing emoji gets one space appended per emoji, breaking the right side of the box, which is otherwise appropriately-sized for its content.
The extra spaces do not seem to appear when emojis are printed in a Text element outside of a Box.
Example code:
const Board = () => {
return (
<Box flexDirection='column' alignItems='flex-start'>
<Box borderStyle='round'>
<Text>🌊</Text>
</Box>
<Box borderStyle='round'>
<Text>🌊🌊</Text>
</Box>
<Box borderStyle='round'>
<Text>🌊🌊🌊</Text>
</Box>
</Box>
)
};
Example output:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Emoji rendered in Chrome have different widths than in other ...
It seems like the width of emojis as rendered in Chrome is less than the actual character width.
Read more >Extra spacing after emoji variants · Issue #1978 · kovidgoyal/kitty
The reason you're seing extra spaces after the sun emojis is that the output actually contains extra spaces. This is probably done because...
Read more >Why do emojis sometimes come up as blank squares? - Quora
Any character for which your system does not have the font to render, or which is not defined in the document character set,...
Read more >font-variant-emoji - CSS: Cascading Style Sheets | MDN
This example shows how you can render an emoji in its text or emoji presentation. HTML.
Read more >Chrome visual bug: Emoji next to text (no space displayed)
I think it's when the emoji is cached that we lose the space. And it's not as much losing the space, but Chrome...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@goldbergyoni The explanation is provided by the close message: it was closed because PR #444 resolved the issue and was merged.
@vadimdemedes Why are you closing these line of issues without any explanation?
Edit: my bad, watched this using mobile and it looked like ‘close’ message without related PR