Closed sus2790 closed 2 months ago
You probably want to use align rather than justify for multi-line text:
from rich.align import Align
from rich.console import Console
from rich.text import Text
BANNER = """
'||' '||'
|| || .... ... ... ... .... ... ..
||''''|| '|. | ||' || .|...|| ||' ''
|| || '|.| || | || ||
.||. .||. '| ||...' '|...' .||.
.. | ||
'' ''''
"""
console = Console()
banner_text = Align.center(Text(BANNER))
console.print(banner_text)
I hope we solved your problem.
If you like using Rich, you might also enjoy Textual
ohh.... I didn't notice that..
Describe the bug
Original:
Output:
Expect:
The banner just looks werid, not much to say.
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? Windows 11 What terminal software are you using? Python 3.12.2 / Vscode 1.88.0 ╭─────────────────────────