Hi, All,
Continuation of the previous post !
You certainly noticed that, in the 4 last cases of the previous post, the numbers are always moved back, right after the ABC DEF string, because digits, as bi-directional weak char, are considered as belonging to the last embedded directional range. So, how to force the numbers to stay, after the GHI JKL MNO PQR STU string, already written in the Right to Left direction ?
For such a task, and to compensate for the lack of the Isolates formating characters, we need to use one of the Implicit Directional Marks, below, which do work, too, with Notepad++ ;-))
- LEFT-TO-RIGHT MARK LRM 200E
- RIGHT-TO-LEFT MARK RLM 200F
- ARABIC LETTER MARK ALM 061C
These characters are very light-weight formatting and act, simply, as a bidirectional strong char, with the L or R type
So, we get 4 more cases :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <LRM>123, 456 VWX YZA
ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA ( 47 chars )
─► The "ABC DEF " string is written with the DEFAULT direction of the CURRENT embedding level (level 0), so with the "Left to Right" direction
─► The "GHI JKL MNO PQR STU" string, from right AFTER the <RLO> formating char, till the <PDF> formating char (level 1), is written in the "Right to Left" direction
─► The SPACE char, as a NEUTRAL char, is written in the CURRENT bi-directional direction, of level 0, so "Left to Right"
─► Finally, the INVISIBLE <LRM> mark, acting as a STRONG "Left to Right" character forces ALL remaining text, so the string "123, 456 VWX YZA", to be rewritten in the "Left to Right" direction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <LRM><RLO>123<PDF>, <LRM><RLO>456<PDF> VWX YZA
ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA ( 52 chars )
─► The "ABC DEF " string is written with the DEFAULT direction of the CURRENT embedding level (level 0), so with the "Left to Right" direction
─► The "GHI JKL MNO PQR STU" string, from right AFTER the FIRST <RLO> formating char, till the FIRST <PDF> formating char (level 1), is written in the "Right to Left" direction
─► The SPACE char, as a NEUTRAL char, is written in the CURRENT bi-directional direction, of level 0, so "Left to Right"
─► The INVISIBLE <LRM> mark, acting as a STRONG "Left to Right" character forces the context string "123, ", with the WEAK bidirectional digits , to be rewritten in the "Left to Right" direction
─► But the "123" number, from right after the SECOND <RLO> formating char, till the SECOND <PDF> formating char (level 1) is written, in the "Right to Left" direction
─► Again, the INVISIBLE <LRM> mark, acting as a STRONG "Left to Right" character forces the string "456", with the WEAK bidirectional digits , to be rewritten in the "Left to Right" direction, so AFTER the "123, " string
─► But the "456" number, from right after the THIRD <RLO> formating char, till the THIRD <PDF> formating char (level 1) is written, in the "Right to Left" direction
─► Finally, the " VWX YZA" string, after the THIRD <PDF> formating char, is written with the DEFAULT direction (level 0), so in the "Left to Right" direction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <LRM><RLO>123, 456<PDF> VWX YZA
ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA ( 49 chars )
─► The "ABC DEF " string is written with the DEFAULT direction of the CURRENT embedding level (level 0), so with the "Left to Right" direction
─► The "GHI JKL MNO PQR STU" string, from right AFTER the FIRST <RLO> formating char, till the FIRST <PDF> formating char (level 1), is written, in the "Right to Left" direction
─► The SPACE char, as a NEUTRAL char, is written in the CURRENT bi-directional direction, of level 0, so "Left to Right"
─► The INVISIBLE <LRM> mark, acting as a STRONG "Left to Right" character forces EACH remaining block of text, to be rewritten in the "Left to Right" direction
─► However, the "123, 456" string, from right AFTER the SECOND <RLO> formating char, till the SECOND <PDF> formating char (level 1) must be written, in the "Right to Left" direction
─► Finally, the " VWX YZA" string, after the SECOND <PDF> formating char, is written with the DEFAULT direction (level 0), so in the "Left to Right" direction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <LRM><RLO><LRO>123<PDF>, <LRO>456<PDF><LRM><PDF> VWX YZA
ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA ( 54 chars )
─► The "ABC DEF " string is written with the DEFAULT direction of the CURRENT embedding level (level 0), so with the "Left to Right" direction
─► The "GHI JKL MNO PQR STU" string, from right AFTER the FIRST <RLO> formating char, till the FIRST <PDF> formating char (level 1), is written in the "Right to Left" direction
─► The SPACE char, as a NEUTRAL char, is written in the CURRENT bi-directional direction, of level 0, so "Left to Right"
─► The INVISIBLE <LRM> mark, acting as a STRONG "Left to Right" character, forces the context-numbers string to NOT depends on the FIRST <RLO>........<PDF> range
─► Then the "123, 456", right after the SECOND <RLO> formating char, till the FOURTH <PDF> formating char, is rewritten in the "Right to Left" direction (leval 1)
─► But the "123" number, from right after the FIRST <LRO> formating char, till the SECOND <PDF> formating char (level 1) is written, in the "Left to Right" direction (level 2)
─► The ", " string is written according to the CURRENT direction of the SECOND <RLO>........<PDF>range, starting at the SECOND <RLO> formating char, till the FOURTH (level 1), so in the "Right to Left" direction
─► The "456" number, from right after the SECOND <LRO> formating char, till the THIRD <PDF> formating char (level 2) is written, in the "Left to Right" direction (level 2)
─► The INVISIBLE <LRM> mark, acting as a STRONG "Left to Right" character, forces the " VWX YZA" string, to be written in the "Left to Right" direction (level 0) However, note that I did NOT understand WHY I had to locate the <LRM> mark BEFORE the LAST <PDF> formating char ( and NOT after ) to get the right behavior !
So, in short, starting with the 2 sample texts ABC DEF GHI JKL MNO PQR STU VWX YZA and ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA, the syntaxes, below :
ABC DEF <RLO>GHI JKL MNO PQR STU VWX YZA
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> VWX YZA
ABC DEF <RLO>GHI JKL<PDF> MNO <LRO>PQR STU<PDF> VWX YZA
ABC DEF <RLO>GHI JKL <LRO>MNO PQR<PDF> STU<PDF> VWX YZA
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> 123, 456 VWX YZA
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <RLO>123, 456<PDF> VWX YZA
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <LRO>123, 456<PDF> VWX YZA
ABC DEF <LRO><RLO>123<PDF>, <RLO>456<PDF><PDF> <RLO>GHI JKL MNO PQR STU<PDF> VWX YZA
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <LRM>123, 456 VWX YZA
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <LRM><RLO>123<PDF>, <LRM><RLO>456<PDF> VWX YZA
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <LRM><RLO>123, 456<PDF> VWX YZA
ABC DEF <RLO>GHI JKL MNO PQR STU<PDF> <LRM><RLO><LRO>123<PDF>, <LRO>456<PDF><LRM><PDF> VWX YZA
produce the corresponding results, below :
( 36 chars ) ABC DEF GHI JKL MNO PQR STU VWX YZA
( 37 chars ) ABC DEF GHI JKL MNO PQR STU VWX YZA
( 39 chars ) ABC DEF GHI JKL MNO PQR STU VWX YZA
( 39 chars ) ABC DEF GHI JKL MNO PQR STU VWX YZA
( 46 chars ) ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA
( 48 chars ) ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA
( 48 chars ) ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA
( 52 chars ) ABC DEF 123, 456 GHI JKL MNO PQR STU VWX YZA
( 47 chars ) ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA
( 52 chars ) ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA
( 49 chars ) ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA
( 54 chars ) ABC DEF GHI JKL MNO PQR STU 123, 456 VWX YZA
As you may verify, by yourself, the 4 first and the 8 last results, of the last table, have, seemingly, the same width. This proves that, in all cases, the Unicode formating characters are zero-width chars ;-))
Best Regards,
guy038
P.S. :
Some of my explanations may be confusing, approximate or false. It is quite natural because this is a complex area !!