andygrove opened a new issue, #2013:
URL: https://github.com/apache/datafusion-ballista/issues/2013
## Describe the bug
The `ballista-cli` TUI banner renders as garbled characters / tofu boxes
rather than the "DataFusion Ballista" wordmark. Reported on macOS, but it will
reproduce almost anywhere.
Copying the garbled region out of the terminal yields characters like:
```
🬂██🬂🬎🬹🬠ðŸ¬ðŸ¬ðŸ¬ðŸ¬ ðŸ¬ðŸ¬¹â–ˆðŸ¬ðŸ¬ ðŸ¬ðŸ¬ðŸ¬ðŸ¬
```
Those are U+1FB02, U+1FB0E, U+1FB39, U+1FB2D — **sextants**, from Unicode's
*Symbols for Legacy Computing* block. Most monospace fonts do not include that
block, so they render as tofu.
## Root cause
`render_banner` in `ballista-cli/src/tui/ui/header/mod.rs` selects the
`tui-big-text` `PixelSize` by width, and every branch it can pick draws from
Symbols for Legacy Computing:
```rust
let banner_size = match area.width {
0..70 => PixelSize::Octant, // U+1CD00 octants (Unicode 16)
70..80 => PixelSize::QuarterHeight, // also U+1CD00 octants
_ => PixelSize::ThirdHeight, // U+1FB00 sextants
};
```
`tui-big-text` documents exactly this hazard on all three variants:
> *Note: depending on how the used terminal renders characters, the
generated text with this PixelSize might look very strange.*
The library's other pixel sizes (`Full`, `HalfHeight`, `HalfWidth`,
`Quadrant`) draw only from **Block Elements** (U+2580..U+259F), which is
universally supported — but none of them are reachable in the current code.
The reason the code ended up on the exotic sizes is the header height.
`ui::render` gives the header `Constraint::Length(6)` and the banner is two
lines, so each line gets 3 rows. Per `PixelSize::pixels_per_cell`, every size
that fits two lines into 6 rows is a legacy-computing one:
| PixelSize | cols/char | rows/char | glyph block |
|---|---|---|---|
| Full | 8 | 8 | Block Elements |
| HalfHeight | 8 | 4 | Block Elements |
| HalfWidth | 4 | 8 | Block Elements |
| Quadrant | 4 | 4 | Block Elements |
| ThirdHeight | 8 | 3 | Sextants |
| Sextant | 4 | 3 | Sextants |
| QuarterHeight | 8 | 2 | Octants |
| Octant | 4 | 2 | Octants |
So the 6-row header is the real root cause; the glyph choice is downstream
of it.
Note that picking a different font is not a viable workaround: the
`Octant`/`QuarterHeight` branches need U+1CD00, added in Unicode 16 (Sept
2024), which essentially no shipping font carries.
## To Reproduce
Run `ballista-cli` with the TUI on any terminal whose font lacks Symbols for
Legacy Computing (the common case) and look at the header.
## Expected behavior
The banner renders legibly using glyphs available in ordinary monospace
fonts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]