-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvte-acid-test-unicode-emoji.sh
executable file
·91 lines (76 loc) · 2.87 KB
/
vte-acid-test-unicode-emoji.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#! /usr/bin/env zsh
# This file is part of the "libterminal" project
# Copyright (c) 2019-2020 Christian Parpart <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# {{{ helper
function sgr() {
local params="$(echo ${@} | sed 's/ /;/g')"
echo -ne "\e[${params}m"
}
function sgr_line() {
sgr "${@}"
printf "\033[2K" # EL, Erase in line
}
uc_title() {
sgr_line 41 1
printf -ne " $(sgr 21)${1}$(sgr 0)\n"
}
uc_heading() {
sgr_line 41 1 4
uc_row "AB" "p.style" "comment$(sgr 0)"
}
uc_section() {
sgr_line 44 1 4
printf "│ │ (${1})"
sgr 0
printf "\n"
}
sgr_col() {
printf "\033[5G"
}
uc_row() {
local codepoints="$(printf "${1}")"
local presentation_style="${2}"
local comment="${3}"
printf "│${1}│ %7s │ %s\n" "${presentation_style}" "${comment}"
}
# }}}
main() {
clear
# uc_title "VTE Unicode Acid Test"
uc_heading "AB" "P.style" "Comment"
uc_section "text default"
uc_row "\u00A9 " "Text" "copyright symbol" # add a space because it's meant to be Narrow-width
uc_row "\u26A0 " "Text" "construction symbol" # add a space because it's meant to be Narrow-width
uc_section "emoji default - simple codepoints"
uc_row "\U0001F600" "Emoji" "standard smiling face"
uc_row "\U0001F926" "Emoji" "facepalm"
uc_section "ZWH - zero width joining characters"
uc_row "\U0001F441\UFE0F\U200D\U0001F5E8\UFE0F" "Emoji" "Eye with speech bubble"
uc_row "\U0001F926\U0001F3FC\u200D\u2642\uFE0F" "Emoji" "facepalm with fitzpatrick type-3, male sign"
uc_row "\U0001F468\u200D\U0001F469\u200D\U0001F467\u200D\U0001F466" "Emoji" "family"
uc_section "VS16: text default override to emoji"
uc_row "\u00A9\uFE0F" "Emoji" "copyright emoji"
uc_row "\u26A0\uFE0F" "Text" "construction emoji" # add a space because it's meant to be Narrow-width
uc_row "\U0001F441\UFE0F" "Emoji" "eye"
uc_row "\U0001F5E8\UFE0F" "Emoji" "speech bubble"
uc_row "\U0001F926\U0001F3FC" "Emoji" "facepalm with fitzpatrick type-3 modifier"
uc_section "VS15: emoji default override to text"
uc_row "\U0001F600\uFE0E" "Text" "standard smiling face"
uc_row "\U0001F602\uFE0E" "Text" "another face"
uc_section "Flag Sequences"
uc_row "\U0001F1FA\U1F1F8" "Emoji" "USA flag"
uc_row $'\U0001F3F4\U000E0067\U000E0062\U000E0065\U000E006E\U000E0067\U000E007F' "Emoji" "England"
}
main
COL="\033[41m"
RST="\033[m"
#echo -ne "${COL}|\U0001F926\U0001F3FC\u200D\u2642\uFE0F${RST}\n"