Home > OS >  Text art/Banner Not Appearing In cmd Prompt (Unicode/ASCII)
Text art/Banner Not Appearing In cmd Prompt (Unicode/ASCII)

Time:11-06

I would like this to appear in cmd prompt either when I execute the file from cmd prompt or by running from a batch file:

⢸⣿⣿⣿⣿⠃⠄⢀⣴⡾⠃⠄⠄⠄⠄⠄⠈⠺⠟⠛⠛⠛⠛⠻⢿⣿⣿⣿⣿⣶⣤⡀⠄
⢸⣿⣿⣿⡟⢀⣴⣿⡿⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣸⣿⣿⣿⣿⣿⣿⣿⣷
⢸⣿⣿⠟⣴⣿⡿⡟⡼⢹⣷⢲⡶⣖⣾⣶⢄⠄⠄⠄⠄⠄⢀⣼⣿⢿⣿⣿⣿⣿⣿⣿⣿
⢸⣿⢫⣾⣿⡟⣾⡸⢠⡿⢳⡿⠍⣼⣿⢏⣿⣷⢄⡀⠄⢠⣾⢻⣿⣸⣿⣿⣿⣿⣿⣿⣿
⡿⣡⣿⣿⡟⡼⡁⠁⣰⠂⡾⠉⢨⣿⠃⣿⡿⠍⣾⣟⢤⣿⢇⣿⢇⣿⣿⢿⣿⣿⣿⣿⣿
⣱⣿⣿⡟⡐⣰⣧⡷⣿⣴⣧⣤⣼⣯⢸⡿⠁⣰⠟⢀⣼⠏⣲⠏⢸⣿⡟⣿⣿⣿⣿⣿⣿
⣿⣿⡟⠁⠄⠟⣁⠄⢡⣿⣿⣿⣿⣿⣿⣦⣼⢟⢀⡼⠃⡹⠃⡀⢸⡿⢸⣿⣿⣿⣿⣿⡟
⣿⣿⠃⠄⢀⣾⠋⠓⢰⣿⣿⣿⣿⣿⣿⠿⣿⣿⣾⣅⢔⣕⡇⡇⡼⢁⣿⣿⣿⣿⣿⣿⢣
⣿⡟⠄⠄⣾⣇⠷⣢⣿⣿⣿⣿⣿⣿⣿⣭⣀⡈⠙⢿⣿⣿⡇⡧⢁⣾⣿⣿⣿⣿⣿⢏⣾
⣿⡇⠄⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢻⠇⠄⠄⢿⣿⡇⢡⣾⣿⣿⣿⣿⣿⣏⣼⣿
⣿⣷⢰⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⢰⣧⣀⡄⢀⠘⡿⣰⣿⣿⣿⣿⣿⣿⠟⣼⣿⣿
⢹⣿⢸⣿⣿⠟⠻⢿⣿⣿⣿⣿⣿⣿⣿⣶⣭⣉⣤⣿⢈⣼⣿⣿⣿⣿⣿⣿⠏⣾⣹⣿⣿
⢸⠇⡜⣿⡟⠄⠄⠄⠈⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟⣱⣻⣿⣿⣿⣿⣿⠟⠁⢳⠃⣿⣿⣿
⠄⣰⡗⠹⣿⣄⠄⠄⠄⢀⣿⣿⣿⣿⣿⣿⠟⣅⣥⣿⣿⣿⣿⠿⠋⠄⠄⣾⡌⢠⣿⡿⠃
⠜⠋⢠⣷⢻⣿⣿⣶⣾⣿⣿⣿⣿⠿⣛⣥⣾⣿⠿⠟⠛⠉⠄⠄

I created a text file for it and tried to open that txt file within the batch file but it shows a bunch of gibberish. Here is the batch file code:

@ECHO OFF
Art Gallery
color 0b
mode 300
ECHO Welcome to Art!
pause>null
cls


ECHO this is art
ECHO.
type Test1.txt
pause>null
del null

I installed a braille font and added it to the registry but didn't appear under properties. I'm not too familiar with scripting so feel to give constructive feedback.

Thank you!

CodePudding user response:

Thanks to a pointer by @Squashman we can add a small system FONT command, one of many by enter image description here

You will need to ensure Font.exe from that lib is found in your current path or else add the full path into the code (remove the rem before set path). Note although I used MS Gothic others will also work and you can also set font style such as weight or use different character width/height.

@echo off & cls & Title Face
::ÿþ

REM for this usage setlocal is surplus to requirement but included if needed later
rem setlocal enableExtensions enableDelayedExpansion

rem set "path=c:\wherever font.exe is e.g c:\utils\systools;%path%"

for /f "delims=" %%f in ('Font -s') do @set "OLD_Font=%%f"
Font "MS Gothic"
for /f "tokens=2 delims=:."  %%c in ('ChCp') do @set "OLD_ChCp=%%~c"
if not defined OLD_ChCp set "OLD_ChCp=850"

ChCp 65001>nul
echo/

for %%e in (
⢸⣿⣿⣿⣿⠃⠄⢀⣴⡾⠃⠄⠄⠄⠄⠄⠈⠺⠟⠛⠛⠛⠛⠻⢿⣿⣿⣿⣿⣶⣤⡀⠄
⢸⣿⣿⣿⡟⢀⣴⣿⡿⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣸⣿⣿⣿⣿⣿⣿⣿⣷
⢸⣿⣿⠟⣴⣿⡿⡟⡼⢹⣷⢲⡶⣖⣾⣶⢄⠄⠄⠄⠄⠄⢀⣼⣿⢿⣿⣿⣿⣿⣿⣿⣿
⢸⣿⢫⣾⣿⡟⣾⡸⢠⡿⢳⡿⠍⣼⣿⢏⣿⣷⢄⡀⠄⢠⣾⢻⣿⣸⣿⣿⣿⣿⣿⣿⣿
⡿⣡⣿⣿⡟⡼⡁⠁⣰⠂⡾⠉⢨⣿⠃⣿⡿⠍⣾⣟⢤⣿⢇⣿⢇⣿⣿⢿⣿⣿⣿⣿⣿
⣱⣿⣿⡟⡐⣰⣧⡷⣿⣴⣧⣤⣼⣯⢸⡿⠁⣰⠟⢀⣼⠏⣲⠏⢸⣿⡟⣿⣿⣿⣿⣿⣿
⣿⣿⡟⠁⠄⠟⣁⠄⢡⣿⣿⣿⣿⣿⣿⣦⣼⢟⢀⡼⠃⡹⠃⡀⢸⡿⢸⣿⣿⣿⣿⣿⡟
⣿⣿⠃⠄⢀⣾⠋⠓⢰⣿⣿⣿⣿⣿⣿⠿⣿⣿⣾⣅⢔⣕⡇⡇⡼⢁⣿⣿⣿⣿⣿⣿⢣
⣿⡟⠄⠄⣾⣇⠷⣢⣿⣿⣿⣿⣿⣿⣿⣭⣀⡈⠙⢿⣿⣿⡇⡧⢁⣾⣿⣿⣿⣿⣿⢏⣾
⣿⡇⠄⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢻⠇⠄⠄⢿⣿⡇⢡⣾⣿⣿⣿⣿⣿⣏⣼⣿
⣿⣷⢰⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⢰⣧⣀⡄⢀⠘⡿⣰⣿⣿⣿⣿⣿⣿⠟⣼⣿⣿
⢹⣿⢸⣿⣿⠟⠻⢿⣿⣿⣿⣿⣿⣿⣿⣶⣭⣉⣤⣿⢈⣼⣿⣿⣿⣿⣿⣿⠏⣾⣹⣿⣿
⢸⠇⡜⣿⡟⠄⠄⠄⠈⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟⣱⣻⣿⣿⣿⣿⣿⠟⠁⢳⠃⣿⣿⣿
⠄⣰⡗⠹⣿⣄⠄⠄⠄⢀⣿⣿⣿⣿⣿⣿⠟⣅⣥⣿⣿⣿⣿⠿⠋⠄⠄⣾⡌⢠⣿⡿⠃
⠜⠋⢠⣷⢻⣿⣿⣶⣾⣿⣿⣿⣿⠿⣛⣥⣾⣿⠿⠟⠛⠉⠄⠄
) do @echo %%e

echo/
pause

REM tidy-up
Font %OLD_Font%
set OLD_Font=
ChCp %OLD_ChCp%>nul
set OLD_ChCp=
endlocal
REM exit

CodePudding user response:

You have a text file that contains the Braille characters from the Unicode block U 28xx.

While I've not used a braille font yet, I think it is there to represent the normal characters (A-Z etc.) in Braille, meaning: the ASCII character 65 or A will be displayed as . This makes it easier for non-blind humans to switch between "readable" and Braille text. They can type as usual.

The gibberish probably looked like this. This is a UTF-8 file printed on codepage 850:

E:\>type text1.txt
Ôó©Ôú┐Ôú┐Ôú┐Ôú┐ÔáâÔáäÔóÇÔú┤Ôí¥ÔáâÔáäÔáäÔáäÔáäÔáäÔáêÔá║ÔáƒÔáøÔáøÔáøÔáøÔá╗Ôó┐Ôú┐Ôú┐Ôú┐Ôú┐ÔúÂÔúñÔíÇÔáä
Ôó©Ôú┐Ôú┐Ôú┐ÔíƒÔóÇÔú┤Ôú┐Ôí┐ÔáüÔáäÔáäÔáäÔáäÔáäÔáäÔáäÔáäÔáäÔáäÔáäÔáäÔáäÔáäÔú©Ôú┐Ôú┐Ôú┐Ôú┐Ôú┐Ôú┐Ôú┐ÔúÀ
Ôó©Ôú┐Ôú┐ÔáƒÔú┤Ôú┐Ôí┐ÔíƒÔí╝Ôó╣ÔúÀÔó▓ÔíÂÔúûÔú¥ÔúÂÔóäÔáäÔáäÔáäÔáäÔáäÔóÇÔú╝Ôú┐Ôó┐Ôú┐Ôú┐Ôú┐Ôú┐Ôú┐Ôú┐Ôú┐

With above in mind, you could change the codepage to UTF-8, i.e.

chcp 65001

but it will not help much, since most of the Console fonts don't have the Braille characters built-in and the result will look like this

E:\>type text1.txt
☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒
☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒
☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒☒

If you happen to have Asian language support installed, you'll see that changing the codepage indeed helps. The MS Gothic and NSimSun fonts come with Braille but has some issues in line 6 and 11, maybe some combining diacritics? I don't exactly know and I'm not familiar with Unicode to that level.

MS Gothic

  • Related