[vte/wip/egmont/bidi: 14/15] perf,bidi: Add BiDi demo and info files



commit a68030122b5fb5f0aa1477a6273b9b14d94a5dc8
Author: Egmont Koblinger <egmont gmail com>
Date:   Fri Jun 7 22:22:22 2019 +0200

    perf,bidi: Add BiDi demo and info files

 perf/bidi-demo.txt | 287 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 perf/bidi.sh       |  39 ++++++++
 2 files changed, 326 insertions(+)
---
diff --git a/perf/bidi-demo.txt b/perf/bidi-demo.txt
new file mode 100644
index 00000000..de7c099c
--- /dev/null
+++ b/perf/bidi-demo.txt
@@ -0,0 +1,287 @@
+                         ╔════════════════════════════╗
+═════════════════════════╣ BiDi test – for 80 columns ╠═════════════════════════
+                         ╚════════════════════════════╝
+
+Test cases are structured like this:
+
+Title (bold)
+Optional LTR explanation of the logical order (normal)
+Reference rendering using similarly looking LTR glyphs (green)
+Actual rendering, needs to match the reference rendering (cyan)
+
+All words, except for the explanation of the logical order wherever it’s
+deliberately reversed, should show up in human readable order.
+
+Some test cases are marked as “should look broken”. This means that the
+overall look is not what humans are looking for; still, the actual rendering
+needs to match the reference rendering.
+
+At Arabic shaping tests, runs of connected letters are denoted.
+
+At box tests the reference rendering is upside down, so you should get nice
+squares everywhere.
+
+                              ┌──────────────────┐
+──────────────────────────────┤ 1 – Implicit LTR ├──────────────────────────────
+                              └──────────────────┘
+LTR + RTL
+Hello1 ⸤Hello23⸣ Hello456 Shlm1 ⸤Shlm23⸣ Shlm456
+Hello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w
+Hello1 ⸤Hello23⸣ Hello456 שָׁלוֹם1 ⸤שָׁלוֹם23⸣ שָׁלוֹם456
+
+RTL + LTR
+Shlm1 ⸤Shlm23⸣ Shlm456 Hello1 ⸤Hello23⸣ Hello456
+456oi7w ⸢23oi7w⸥ 1oi7w Hello1 ⸤Hello23⸣ Hello456
+שָׁלוֹם1 ⸤שָׁלוֹם23⸣ שָׁלוֹם456 Hello1 ⸤Hello23⸣ Hello456
+
+Paragraph wrapping at foreign word
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor w
+oi7 incididunt ut labore et dolore magna aliqua.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor שָׁלוֹם incididunt ut 
labore et dolore magna aliqua.
+
+Double wide
+a<z  n>x
+a<z  א<ת
+
+Arabic shaping
+──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶
+الطرفية – استعمل سطر الأوامر
+
+Combining accents
+Shlm Hungarian accents demo
+oi7w Árvíztűrő tükörfúrógép
+שָׁלוֹם Árvíztűrő tükörfúrógép
+
+Box
+┏━┓   a╔═╗z  n┌─┐x   ╭─╮
+┗━┛   a╚═╝z  א┘─└ת   ╰─╯
+
+Box in mirrored mode
+┏━┓   a╔═╗z  n┌─┐x   ╭─╮[?2500h
+┗━┛   a╚═╝z  א└─┘ת   ╰─╯[?2500l
+
+                              ┌──────────────────┐
+──────────────────────────────┤ 2 – Implicit RTL ├──────────────────────────────
+                              └──────────────────┘
+LTR + RTL
+Hello1 ⸤Hello23⸣ Hello456 Shlm1 ⸤Shlm23⸣ Shlm456
+                                456oi7w ⸢23oi7w⸥ 1oi7w Hello1 ⸤Hello23⸣ Hello456
+[2 kHello1 ⸤Hello23⸣ Hello456 שָׁלוֹם1 ⸤שָׁלוֹם23⸣ שָׁלוֹם456[1 k
+
+RTL + LTR
+Shlm1 ⸤Shlm23⸣ Shlm456 Hello1 ⸤Hello23⸣ Hello456
+                                Hello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w
+[2 kשָׁלוֹם1 ⸤שָׁלוֹם23⸣ שָׁלוֹם456 Hello1 ⸤Hello23⸣ Hello456[1 k
+
+Paragraph with wrong direction (should look broken)
+w Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+                                .incididunt ut labore et dolore magna aliqua oi7
+[2 kLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor שָׁלוֹם incididunt 
ut labore et dolore magna aliqua.[1 k
+
+Double wide
+                                                                      a<z  n>x
+[2 kא<ת  a<z[1 k
+
+Arabic shaping
+                                                    ──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶
+[2 kالطرفية – استعمل سطر الأوامر[1 k
+
+Old Hungarian Rovásírás
+(font at https://github.com/OldHungarian/old-hungarian-font)
+                                                         ΛᛩHTΛᛩMↄH ↄ4TH4Λↄ¤ᛝ +ΛↃ
+[2 k𐲛𐳖𐳇 𐲏𐳪𐳙𐳍𐳀𐳢𐳐𐳀𐳙 𐲢𐳛𐳮𐳁𐳤𐳑𐳢𐳁𐳤[1 k
+
+Combining accents
+Shlm Hungarian accents demo
+                                                     Árvíztűrő tükörfúrógép oi7w
+[2 kשָׁלוֹם Árvíztűrő tükörfúrógép[1 k
+
+Box
+                                                        ╭─╮   a┌─┐z  n╔═╗x   ┏━┓[2 k
+┛━┗   א╝═╚ת  a└─┘z   ╯─╰[1 k
+
+Box in mirrored mode
+                                                        ╭─╮   a┌─┐z  n╔═╗x   ┏━┓[2 k[?2500h
+┗━┛   א╚═╝ת  a└─┘z   ╰─╯[?2500l[1 k
+
+                      ┌──────────────────────────────────┐
+──────────────────────┤ 3 – Implicit auto (LTR fallback) ├──────────────────────
+                      └──────────────────────────────────┘
+LTR + RTL
+Hello1 ⸤Hello23⸣ Hello456 Shlm1 ⸤Shlm23⸣ Shlm456
+Hello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w
+[?2501hHello1 ⸤Hello23⸣ Hello456 שָׁלוֹם1 ⸤שָׁלוֹם23⸣ שָׁלוֹם456[?2501l
+
+RTL + LTR
+Shlm1 ⸤Shlm23⸣ Shlm456 Hello1 ⸤Hello23⸣ Hello456
+                                Hello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w
+[?2501hשָׁלוֹם1 ⸤שָׁלוֹם23⸣ שָׁלוֹם456 Hello1 ⸤Hello23⸣ Hello456[?2501l
+
+Paragraph wrapping at foreign word
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor w
+oi7 incididunt ut labore et dolore magna aliqua.
+[?2501hLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor שָׁלוֹם 
incididunt ut labore et dolore magna aliqua.[?2501l
+
+Arabic shaping
+                                                    ──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶
+[?2501hالطرفية – استعمل سطر الأوامر[?2501l
+
+Combining accents
+Shlm Hungarian accents demo
+                                                     Árvíztűrő tükörfúrógép oi7w
+[?2501hשָׁלוֹם Árvíztűrő tükörfúrógép[?2501l
+
+Box
+┏━┓   a╔═╗z  n┌─┐x   ╭─╮[?2501h
+┗━┛   a╚═╝z  א┘─└ת   ╰─╯[?2501l
+
+Box in mirrored mode
+┏━┓   a╔═╗z  n┌─┐x   ╭─╮[?2501h[?2500h
+┗━┛   a╚═╝z  א└─┘ת   ╰─╯[?2500l[?2501l
+
+                      ┌──────────────────────────────────┐
+──────────────────────┤ 4 – Implicit auto (RTL fallback) ├──────────────────────
+                      └──────────────────────────────────┘
+LTR + RTL
+Hello1 ⸤Hello23⸣ Hello456 Shlm1 ⸤Shlm23⸣ Shlm456
+Hello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w
+[2 k[?2501hHello1 ⸤Hello23⸣ Hello456 שָׁלוֹם1 ⸤שָׁלוֹם23⸣ שָׁלוֹם456[?2501l[1 k
+
+RTL + LTR
+Shlm1 ⸤Shlm23⸣ Shlm456 Hello1 ⸤Hello23⸣ Hello456
+                                Hello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w
+[2 k[?2501hשָׁלוֹם1 ⸤שָׁלוֹם23⸣ שָׁלוֹם456 Hello1 ⸤Hello23⸣ Hello456[?2501l[1 k
+
+Paragraph wrapping at foreign word
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor w
+oi7 incididunt ut labore et dolore magna aliqua.
+[2 k[?2501hLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor שָׁלוֹם 
incididunt ut labore et dolore magna aliqua.[?2501l[1 k
+
+Arabic shaping
+                                                    ──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶
+[2 k[?2501hالطرفية – استعمل سطر الأوامر[?2501l[1 k
+
+Combining accents
+Shlm Hungarian accents demo
+                                                     Árvíztűrő tükörfúrógép oi7w
+[2 k[?2501hשָׁלוֹם Árvíztűrő tükörfúrógép[?2501l[1 k
+
+Box
+                                                        ╭─╮   a┌─┐z  n╔═╗x   ┏━┓[2 k[?2501h
+┛━┗   א╝═╚ת  a└─┘z   ╯─╰[?2501l[1 k
+
+Box in mirrored mode
+                                                        ╭─╮   a┌─┐z  n╔═╗x   ┏━┓[2 k[?2501h[?2500h
+┗━┛   א╚═╝ת  a└─┘z   ╰─╯[?2500l[?2501l[1 k
+
+                              ┌──────────────────┐
+──────────────────────────────┤ 5 – Explicit LTR ├──────────────────────────────
+                              └──────────────────┘
+LTR + fake RTL
+⸤Hello⸣ ⸤mlhS⸣
+⸤Hello⸣ ⸤oi7w⸣
+⸤Hello⸣ ⸤םוֹלשָׁ⸣
+
+Fake RTL + RTL
+⸤mlhS⸣ ⸤Hello⸣
+⸤oi7w⸣ ⸤Hello⸣
+⸤םוֹלשָׁ⸣ ⸤Hello⸣
+
+Arabic shaping
+──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶
+رماوألا رطس لمعتسا – ةيفرطلا
+
+Combining accents
+mlhS Hungarian accents demo
+oi7w Árvíztűrő tükörfúrógép
+םוֹלשָׁ Árvíztűrő tükörfúrógép
+
+Box
+┏━┓   a╔═╗z  n┌─┐x   ╭─╮
+┗━┛   a╚═╝z  ת└─┘א   ╰─╯
+
+Box in mirrored mode
+┏━┓   a╔═╗z  n┌─┐x   ╭─╮[?2500h
+┗━┛   a╚═╝z  ת└─┘א   ╰─╯[?2500l
+
+                              ┌──────────────────┐
+──────────────────────────────┤ 6 – Explicit RTL ├──────────────────────────────
+                              └──────────────────┘
+Fake LTR + RTL
+⸤olleH⸣ ⸤Shlm⸣
+                                                                  ⸢oi7w⸥ ⸢Hello⸥
+[2 k⸤olleH⸣ ⸤שָׁלוֹם⸣[1 k
+
+RTL + fake LTR
+⸤Shlm⸣ ⸤olleH⸣
+                                                                  ⸢Hello⸥ ⸢oi7w⸥
+[2 k⸤שָׁלוֹם⸣ ⸤olleH⸣[1 k
+
+Fullwidth characters with underlines
+                        [Lorem  ipsum  dolor  sit  amet)
+[2 k(tema  tis  rolod  muspi  meroL][1 k
+
+Arabic shaping
+                                                    ──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶
+[2 kالطرفية – استعمل سطر الأوامر[1 k
+
+Combining accents
+Shlm omed stnecca nairagnuH
+                                                     Árvíztűrő tükörfúrógép oi7w
+[2 k[?2501hשָׁלוֹם pégórúfröküt őrűtzívrÁ[?2501l[1 k
+
+Box
+                                                        ╭─╮   a┌─┐z  n╔═╗x   ┏━┓[2 k
+┛━┗   א╝═╚ת  z┘─└a   ╯─╰[1 k
+
+Box in mirrored mode
+                                                        ╭─╮   a┌─┐z  n╔═╗x   ┏━┓[2 k[?2500h
+┗━┛   א╚═╝ת  z└─┘a   ╰─╯[?2500l[1 k
+
+                               ┌────────────────┐
+───────────────────────────────┤ 7 – Misc tests ├───────────────────────────────
+                               └────────────────┘
+Numbers inside RTL, across linebreak
+jumps Shalom 123 456 789 Shalom!
+The quick brown fox jumps over the lazy dog The quick brown fox jumps 4 123 oi7w
+oi7w 789 56!
+The quick brown fox jumps over the lazy dog The quick brown fox jumps שָׁלוֹם 123 456 789 שָׁלוֹם!
+
+Mirroring across linebreak
+jumps Shalom <[<[<[<[ Shalom!
+The quick brown fox jumps over the lazy dog The quick brown fox jumps >]>]> oi7w
+oi7w ]>]!
+The quick brown fox jumps over the lazy dog The quick brown fox jumps שָׁלוֹם <[<[<[<[ שָׁלוֹם!
+
+Attributes
+Hello1 Shlm23 Shlm456 Hello7890
+Hello1 456oi7w 23oi7w Hello7890
+Hello1 שָׁלוֹם23 שָׁלוֹם456 Hello7890
+
+Link autodetection, overall LTR
+https!//he.wikipedia.org/wiki/Front_page
+https!//he.wikipedia.org/wiki/'wxᒣ_tiny
+https://he.wikipedia.org/wiki/עמוד_ראשי
+
+Link autodetection, overall LTR (should look broken)
+https!//he.wikipedia.org/wiki/Front_page Shalom
+https!//he.wikipedia.org/wiki/oi7w 'wxᒣ_tiny
+https://he.wikipedia.org/wiki/עמוד_ראשי שָׁלוֹם
+
+Link autodetection, overall RTL
+Shalom1 http!//example.com/test Shalom23
+                                            23oi7w http!//example.com/test 1oi7w
+[2 kשָׁלוֹם1 http://example.com/test שָׁלוֹם23[1 k
+
+Link autodetection, overall RTL (should look broken)
+Shalom1 http!//example.com/test/ Shalom23
+                                           23oi7w /http!//example.com/test 1oi7w
+[2 kשָׁלוֹם1 http://example.com/test/ שָׁלוֹם23[1 k
+
+Explicit hyperlinks
+Hello1 Shlm23 Shlm456 Hello7890
+Hello1 456oi7w 23oi7w Hello7890
+Hello1 456oi7w 23oi7w Hello7890
+]8;;http://example.com/hello123\Hello1 שָׁלוֹם23]8;;\ 
]8;;http://example.com/hello4567890\שָׁלוֹם456 Hello7890]8;;\
+
+────────────────────────────────────────────────────────────────────────────────
diff --git a/perf/bidi.sh b/perf/bidi.sh
new file mode 100644
index 00000000..a4984606
--- /dev/null
+++ b/perf/bidi.sh
@@ -0,0 +1,39 @@
+# BiDi support in VTE is implemented according to
+# https://terminal-wg.pages.freedesktop.org/bidi/
+#
+# The following aliases allow you to quickly change the BiDi mode.
+#
+# These are not meant to be standardized command names. Customize them
+# according to your liking, and don't rely on them being available for others.
+
+# Bi-Directional Support Mode (BDSM):
+# In implicit mode the terminal emulator performs BiDi.
+# In explicit mode the terminal emulator lays out the characters in linear
+# order, and the application running inside is expected to do BiDi.
+alias implicit='printf "\e[8h"'
+alias explicit='printf "\e[8l"'
+
+# Select Character Path (SCP):
+# Defines the paragraph direction for explicit mode, and for implicit mode
+# without autodetection. Defines the fallback paragraph direction (in case
+# autodetection fails) for implicit mode with autodetection.
+alias ltr='printf "\e[1 k"'
+alias rtl='printf "\e[2 k"'
+# alias defaultdir='printf "\e[ k"' # currently the same as ltr
+
+# Autodetection:
+# Whether in implicit mode the paragraph direction is autodetected (possibly
+# falling back to the value set by SCP), or taken strictly from SCP.
+alias   autodir='printf "\e[?2501h"'
+alias noautodir='printf "\e[?2501l"'
+
+# Box mirroring:
+# Whether box drawing characters are added to the set of mirrorable glyphs.
+alias   boxmirror='printf "\e[?2500h"'
+alias noboxmirror='printf "\e[?2500l"'
+
+# Keyboard arrow swapping:
+# Whether the left and right arrows of the keyboard are swapped whenever the
+# cursor stands within an RTL paragraph.
+alias   kbdswap='printf "\e[?1243h"'
+alias nokbdswap='printf "\e[?1243l"'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]