[vte/wip/egmont/bidi: 11/13] perf,bidi: Add BiDi demo and info files
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/egmont/bidi: 11/13] perf,bidi: Add BiDi demo and info files
- Date: Fri, 7 Jun 2019 21:19:49 +0000 (UTC)
commit a80b1038bdd5a95432abaa4a8be7d0e8abfabbb4
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 | 257 +++++++++++++++++++++++++++++++++++++++++++++++++++++
perf/bidi.sh | 39 ++++++++
2 files changed, 296 insertions(+)
---
diff --git a/perf/bidi-demo.txt b/perf/bidi-demo.txt
new file mode 100644
index 00000000..a71d35b7
--- /dev/null
+++ b/perf/bidi-demo.txt
@@ -0,0 +1,257 @@
+ â•”â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•—
+â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•£ BiDi test – for 80 columns â• â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
+ â•šâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
+
+Test cases are structured like this:
+
+[01mTitle (bold)[m
+Optional LTR explanation of the logical order (normal)
+[32mReference rendering using similarly looking LTR glyphs (green)[m
+[36mActual rendering, needs to match the reference rendering (cyan)[m
+
+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 ├──────────────────────────────
+ └──────────────────┘
+[01mLTR + RTL[m
+[00mHello1 ⸤Hello23⸣ Hello456 Shlm1 ⸤Shlm23⸣ Shlm456[m
+[32mHello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w[m
+[36mHello1 ⸤Hello23⸣ Hello456 שָ×לוֹ×1 ⸤שָ×לוֹ×23⸣ שָ×לוֹ×456[m
+
+[01mRTL + LTR[m
+[00mShlm1 ⸤Shlm23⸣ Shlm456 Hello1 ⸤Hello23⸣ Hello456[m
+[32m456oi7w ⸢23oi7w⸥ 1oi7w Hello1 ⸤Hello23⸣ Hello456[m
+[36mשָ×לוֹ×1 ⸤שָ×לוֹ×23⸣ שָ×לוֹ×456 Hello1 ⸤Hello23⸣ Hello456[m
+
+[01mParagraph wrapping at foreign word[m
+[32mLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor w[m
+[32moi7 incididunt ut labore et dolore magna aliqua.[m
+[36mLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor שָ××œ×•Ö¹× incididunt ut
labore et dolore magna aliqua.[m
+
+[01mDouble wide[m
+[32ma<z n>x[m
+[36ma<z ×<ת[m
+
+[01mArabic shaping[m
+[32m──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶[m
+[36mالطرÙية – استعمل سطر الأوامر[m
+
+[01mBox[m
+[32mâ”â”┓ aâ•”â•â•—z n┌─â”x â•â”€â•®[m
+[36mâ”—â”â”› aâ•šâ•â•z ×┘─└ת ╰─╯[m
+
+[01mBox in mirrored mode[m
+[32mâ”â”┓ aâ•”â•â•—z n┌─â”x â•â”€â•®[m[?2500h
+[36mâ”—â”â”› aâ•šâ•â•z ×└─┘ת ╰─╯[m[?2500l
+
+ ┌──────────────────â”
+──────────────────────────────┤ 2 – Implicit RTL ├──────────────────────────────
+ └──────────────────┘
+[01mLTR + RTL[m
+[00mHello1 ⸤Hello23⸣ Hello456 Shlm1 ⸤Shlm23⸣ Shlm456[m
+ [32m456oi7w ⸢23oi7w⸥ 1oi7w Hello1 ⸤Hello23⸣ Hello456[m
+[36m[2 kHello1 ⸤Hello23⸣ Hello456 שָ×לוֹ×1 ⸤שָ×לוֹ×23⸣ שָ×לוֹ×456[1 k[m
+
+[01mRTL + LTR[m
+[00mShlm1 ⸤Shlm23⸣ Shlm456 Hello1 ⸤Hello23⸣ Hello456[m
+ [32mHello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w[m
+[36m[2 kשָ×לוֹ×1 ⸤שָ×לוֹ×23⸣ שָ×לוֹ×456 Hello1 ⸤Hello23⸣ Hello456[1 k[m
+
+[01mParagraph with wrong direction (should look broken)[m
+[32mw Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor[m
+ [32m.incididunt ut labore et dolore magna aliqua oi7[m
+[36m[2 kLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor שָ××œ×•Ö¹× incididunt
ut labore et dolore magna aliqua.[1 k[m
+
+[01mDouble wide[m
+ [32ma<z n>x[m
+[36m[2 k×<ת a<z[1 k[m
+
+[01mArabic shaping[m
+ [32m──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶[m
+[36m[2 kالطرÙية – استعمل سطر الأوامر[1 k[m
+
+[01mOld Hungarian RovásÃrás[m
+[00m(font at https://github.com/OldHungarian/old-hungarian-font)[m
+ [32mΛᛩHTΛᛩMↄH ↄ4TH4Λↄ¤ᛠ+ΛↃ[m
+[36m[2 kð²›ð³–𳇠ð²ð³ªð³™ð³ð³€ð³¢ð³ð³€ð³™ ð²¢ð³›ð³®ð³ð³¤ð³‘ð³¢ð³ð³¤[1 k[m
+
+[01mBox[m
+ [32mâ•â”€â•® a┌─â”z nâ•”â•â•—x â”â”┓[m[2 k
+[36mâ”›â”â”— ×â•â•â•š×ª a└─┘z ╯─╰[m[1 k
+
+[01mBox in mirrored mode[m
+ [32mâ•â”€â•® a┌─â”z nâ•”â•â•—x â”â”┓[m[2 k[?2500h
+[36mâ”—â”â”› ×â•šâ•â•×ª a└─┘z ╰─╯[m[?2500l[1 k
+
+ ┌──────────────────────────────────â”
+──────────────────────┤ 3 – Implicit auto (LTR fallback) ├──────────────────────
+ └──────────────────────────────────┘
+[01mLTR + RTL[m
+[00mHello1 ⸤Hello23⸣ Hello456 Shlm1 ⸤Shlm23⸣ Shlm456[m
+[32mHello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w[m
+[36m[?2501hHello1 ⸤Hello23⸣ Hello456 שָ×לוֹ×1 ⸤שָ×לוֹ×23⸣ שָ×לוֹ×456[?2501l[m
+
+[01mRTL + LTR[m
+[00mShlm1 ⸤Shlm23⸣ Shlm456 Hello1 ⸤Hello23⸣ Hello456[m
+ [32mHello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w[m
+[36m[?2501hשָ×לוֹ×1 ⸤שָ×לוֹ×23⸣ שָ×לוֹ×456 Hello1 ⸤Hello23⸣ Hello456[?2501l[m
+
+[01mParagraph wrapping at foreign word[m
+[32mLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor w[m
+[32moi7 incididunt ut labore et dolore magna aliqua.[m
+[36m[?2501hLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor שָ×לוֹ×
incididunt ut labore et dolore magna aliqua.[?2501l[m
+
+[01mArabic shaping[m
+ [32m──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶[m
+[36m[?2501hالطرÙية – استعمل سطر الأوامر[?2501l[m
+
+[01mBox[m
+[32mâ”â”┓ aâ•”â•â•—z n┌─â”x â•â”€â•®[m[?2501h
+[36mâ”—â”â”› aâ•šâ•â•z ×┘─└ת ╰─╯[m[?2501l
+
+[01mBox in mirrored mode[m
+[32mâ”â”┓ aâ•”â•â•—z n┌─â”x â•â”€â•®[m[?2501h[?2500h
+[36mâ”—â”â”› aâ•šâ•â•z ×└─┘ת ╰─╯[m[?2500l[?2501l
+
+ ┌──────────────────────────────────â”
+──────────────────────┤ 4 – Implicit auto (RTL fallback) ├──────────────────────
+ └──────────────────────────────────┘
+[01mLTR + RTL[m
+[00mHello1 ⸤Hello23⸣ Hello456 Shlm1 ⸤Shlm23⸣ Shlm456[m
+[32mHello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w[m
+[36m[2 k[?2501hHello1 ⸤Hello23⸣ Hello456 שָ×לוֹ×1 ⸤שָ×לוֹ×23⸣ שָ×לוֹ×456[?2501l[1 k[m
+
+[01mRTL + LTR[m
+[00mShlm1 ⸤Shlm23⸣ Shlm456 Hello1 ⸤Hello23⸣ Hello456[m
+ [32mHello1 ⸤Hello23⸣ Hello456 456oi7w ⸢23oi7w⸥ 1oi7w[m
+[36m[2 k[?2501hשָ×לוֹ×1 ⸤שָ×לוֹ×23⸣ שָ×לוֹ×456 Hello1 ⸤Hello23⸣ Hello456[?2501l[1 k[m
+
+[01mParagraph wrapping at foreign word[m
+[32mLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor w[m
+[32moi7 incididunt ut labore et dolore magna aliqua.[m
+[36m[2 k[?2501hLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor שָ×לוֹ×
incididunt ut labore et dolore magna aliqua.[?2501l[1 k[m
+
+[01mArabic shaping[m
+ [32m──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶[m
+[36m[2 k[?2501hالطرÙية – استعمل سطر الأوامر[?2501l[1 k[m
+
+[01mBox[m
+ [32mâ•â”€â•® a┌─â”z nâ•”â•â•—x â”â”┓[m[2 k[?2501h
+[36mâ”›â”â”— ×â•â•â•š×ª a└─┘z ╯─╰[m[?2501l[1 k
+
+[01mBox in mirrored mode[m
+ [32mâ•â”€â•® a┌─â”z nâ•”â•â•—x â”â”┓[m[2 k[?2501h[?2500h
+[36mâ”—â”â”› ×â•šâ•â•×ª a└─┘z ╰─╯[m[?2500l[?2501l[1 k
+
+ ┌──────────────────â”
+──────────────────────────────┤ 5 – Explicit LTR ├──────────────────────────────
+ └──────────────────┘
+[01mLTR + fake RTL[m
+[00m⸤Hello⸣ ⸤mlhS⸣[m
+[32m⸤Hello⸣ ⸤oi7w⸣[m
+[36m[8l⸤Hello⸣ ⸤×וֹלשָ×⸣[8h[m
+
+[01mFake RTL + RTL[m
+[00m⸤mlhS⸣ ⸤Hello⸣[m
+[32m⸤oi7w⸣ ⸤Hello⸣[m
+[36m[8l⸤×וֹלשָ×⸣ ⸤Hello⸣[8h[m
+
+[01mArabic shaping[m
+[32m──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶[m
+[36m[8lرماوألا رطس لمعتسا – ةيÙرطلا[8h[m
+
+[01mBox[m
+[32mâ”â”┓ aâ•”â•â•—z n┌─â”x â•â”€â•®[m[8l
+[36mâ”—â”â”› aâ•šâ•â•z ×ªâ””â”€â”˜× â•°â”€â•¯[m[8h
+
+[01mBox in mirrored mode[m
+[32mâ”â”┓ aâ•”â•â•—z n┌─â”x â•â”€â•®[m[8l[?2500h
+[36mâ”—â”â”› aâ•šâ•â•z ×ªâ””â”€â”˜× â•°â”€â•¯[m[?2500l[8h
+
+ ┌──────────────────â”
+──────────────────────────────┤ 6 – Explicit RTL ├──────────────────────────────
+ └──────────────────┘
+[01mFake LTR + RTL[m
+[00m⸤olleH⸣ ⸤Shlm⸣[m
+ [32m⸢oi7w⸥ ⸢Hello⸥[m
+[36m[8l[2 k⸤olleH⸣ ⸤שָ×לוֹ×⸣[1 k[8h[m
+
+[01mRTL + fake LTR[m
+[00m⸤Shlm⸣ ⸤olleH⸣[m
+ [32m⸢Hello⸥ ⸢oi7w⸥[m
+[36m[8l[2 k⸤שָ×לוֹ×⸣ ⸤olleH⸣[1 k[8h[m
+
+[01mFullwidth characters with underlines[m
+ [32m[Lï½ï½’ï½…ï½ [4miï½ï½“uï½[24m dï½ï½Œï½ï½’ [21msit[24m ï½ï½ï½…t)[m
+[36m[8l[2 k(teï½ï½ [21mtis[24m ï½’ï½ï½Œï½ï½„ [4mï½ï½•ï½“ï½ï½‰[24m ï½ï½…ï½’ï½ï¼¬ï¼½[1 k[8h[m
+
+[01mArabic shaping[m
+ [32m──╶╶╶─╶ ─── ─────╶ ─ ───╶──╶[m
+[36m[8l[2 kالطرÙية – استعمل سطر الأوامر[1 k[8h[m
+
+[01mBox[m
+ [32mâ•â”€â•® a┌─â”z nâ•”â•â•—x â”â”┓[m[8l[2 k
+[36mâ”›â”â”— ×â•â•â•š×ª z┘─└a ╯─╰[m[1 k[8h
+
+[01mBox in mirrored mode[m
+ [32mâ•â”€â•® a┌─â”z nâ•”â•â•—x â”â”┓[m[8l[2 k[?2500h
+[36mâ”—â”â”› ×â•šâ•â•×ª z└─┘a ╰─╯[m[?2500l[1 k[8h
+
+ ┌────────────────â”
+───────────────────────────────┤ 7 – Misc tests ├───────────────────────────────
+ └────────────────┘
+[01mNumbers inside RTL, across linebreak[m
+[00mjumps Shalom 123 456 789 Shalom![m
+[32mThe quick brown fox jumps over the lazy dog The quick brown fox jumps 4 123 oi7w[m
+[32moi7w 789 56![m
+[36mThe quick brown fox jumps over the lazy dog The quick brown fox jumps שָ××œ×•Ö¹× 123 456 789 שָ×לוֹ×![m
+
+[01mMirroring across linebreak[m
+[00mjumps Shalom <[<[<[<[ Shalom![m
+[32mThe quick brown fox jumps over the lazy dog The quick brown fox jumps >]>]> oi7w[m
+[32moi7w ]>]![m
+[36mThe quick brown fox jumps over the lazy dog The quick brown fox jumps שָ××œ×•Ö¹× <[<[<[<[ שָ×לוֹ×![m
+
+[01mAttributes[m
+[00mHel[4mlo1 Shlm2[24m3 Shl[21mm456 H[24mello7890[m
+[32mHel[4mlo1 [24m[21m456o[24mi7w [4m2[24m3[4moi7w[24m[21m H[24mello7890[m
+[36mHel[4mlo1 שָ×לוֹ×2[24m3 שָ×לוֹ[21m×456 H[24mello7890[m
+
+[01mLink autodetection, overall LTR[m
+[00mhttps!//he.wikipedia.org/wiki/Front_page[m
+[32m[4mhttps!//he.wikipedia.org/wiki/'wxá’£_tiny[24m[m
+[36mhttps://he.wikipedia.org/wiki/עמוד_ר×שי[m
+
+[01mLink autodetection, overall LTR (should look broken)[m
+[00mhttps!//he.wikipedia.org/wiki/Front_page Shalom[m
+[32m[4mhttps!//he.wikipedia.org/wiki/[24moi7w [4m'wxá’£_tiny[24m[m
+[36mhttps://he.wikipedia.org/wiki/עמוד_ר×שי שָ×לוֹ×[m
+
+[01mLink autodetection, overall RTL[m
+[00mShalom1 http!//example.com/test Shalom23[m
+[32m 23oi7w [4mhttp!//example.com/test[24m 1oi7w[m
+[36m[2 kשָ×לוֹ×1 http://example.com/test שָ×לוֹ×23[1 k[m
+
+[01mLink autodetection, overall RTL (should look broken)[m
+[00mShalom1 http!//example.com/test/ Shalom23[m
+[32m 23oi7w [4m/http!//example.com/test[24m 1oi7w[m
+[36m[2 kשָ×לוֹ×1 http://example.com/test/ שָ×לוֹ×23[1 k[m
+
+[01mExplicit hyperlinks[m
+[00m[4mHello1 Shlm23[24m [4mShlm456 Hello7890[24m[m
+[32m[4mHello1 [24m456oi7w [4m23oi7w[24m Hello7890[m
+[32mHello1 [4m456oi7w[24m 23oi7w[4m Hello7890[24m[m
+[36m]8;;http://example.com/hello123\Hello1 שָ×לוֹ×23]8;;\
]8;;http://example.com/hello4567890\שָ×לוֹ×456 Hello7890]8;;\[m
+
+────────────────────────────────────────────────────────────────────────────────
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]