1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-19 20:12:52 +02:00
nerd-fonts/bin/scripts/test-powerlines.sh

69 lines
2.1 KiB
Bash
Raw Normal View History

2018-07-09 16:20:40 +02:00
#!/usr/bin/env bash
2023-01-24 17:56:06 +02:00
# Nerd Fonts Version: 2.3.3
# Script Version: 1.3.0
# Give any parameter to allow some glyphs to be 2 'cells' wide.
# This might or might not be how they are currently handled while patching
text1='Testing'
text2='Nerd Fonts'
leftSymbolsCodes=('E0B0' 'E0B4' 'E0B8' 'E0BC' 'E0C0' 'E0C4' 'E0C6' 'E0C8' 'E0CC' 'E0CD' 'E0CE' 'E0CF' 'E0D0' 'E0D1' 'E0D2')
leftSymbols=('' '' '' '' '' '' '' '' '' '' '' '' '' '' '')
rightSymbolsCodes=('E0B2' 'E0B6' 'E0BA' 'E0BE' 'E0C2' 'E0C5' 'E0C7' 'E0CA' 'E0CC' 'E0CD' 'E0CE' 'E0CF' 'E0D0' 'E0D1' 'E0D4')
rightSymbols=('' '' '' '' '' '' '' '' '' '' '' '' '' '' '')
isWide=(0 0 0 0 1 1 1 1 1 1 1 1 1 1 0)
colorReset='\033[0m'
colorBgWhite='\033[107m'
colorBgLightBlue='\033[104m'
colorBgYellow='\033[103m'
colorBgBlack='\033[40m'
colorBg1='\033[100m'
colorBg2=$colorBgBlack
colorBg3=$colorBgYellow
colorFgLightBlue='\033[94m'
colorFgLightGray='\033[90m'
colorFgLightYellow='\033[93m'
colorFgBlack='\033[30m'
colorFg1=$colorFgBlack
colorFg2=$colorFgLightGray
colorBgDefault='\033[49m'
echo -e "$colorReset Nerd Fonts :: Testing Powerline Symbol size and alignment$colorBg3\\n$colorReset"
for i in "${!leftSymbolsCodes[@]}"; do
pad=' '
pad2=' '
symbol=${leftSymbols[$i]}
symbol2=${rightSymbols[$i]}
code="${leftSymbolsCodes[$i]}"
code2="${rightSymbolsCodes[$i]}"
if [ ${isWide[$i]} -ge 1 -a $# -ge 1 ]; then
symbol="${symbol} "
symbol2="${symbol2} "
pad=
pad2=
fi
if [ "$code" = "$code2" ]; then
symbol2=${rightSymbols[0]}
code2='None'
pad2=' '
fi
echo -e "$colorBg1$colorFg1$text1 $code $colorFg2$colorBg2$symbol$pad $text2 $pad$colorFg1$colorBgDefault$symbol -- $colorFg1$colorBgDefault$symbol2$colorFg2$colorBg2$pad2 $text2 $pad2$symbol2$colorBg1$colorFg1 $code2 $colorReset$colorBg3\\n$colorReset"
done
viSymbolsCodes=('E0A0' 'E0A1' 'E0A2' 'E0A3')
viSymbols=('' '' '' '')
for i in "${!viSymbolsCodes[@]}"; do
symbol=${viSymbols[$i]}
code="${viSymbolsCodes[$i]}"
printf "$colorBg1$colorFg1$text1 $code $colorFg1$colorBgDefault$symbol"
done
echo -e "$colorBg1$colorFg1$text2$colorReset$colorBg3\\n$colorReset"