Page 1 of 1

HTML import and RTL

Posted: Tue Mar 14, 2023 3:43 pm
by jgkoehn
Greetings,
Do you know how to make RTL tags permanent so that Hebrew order is corrected without the RTL tags when importing html?

Re: HTML import and RTL

Posted: Tue Mar 14, 2023 6:12 pm
by jgkoehn
Let me explain a bit better:
There can be: <bdo dir="ltr">....</bdo> or <bdo dir="rtl">....</bdo> I am not sure these are supported in the new Html or the old. They don't seem to be I understand they are complex.
If I use these &#8237; OR &#8236; OR &#8238;
It would be nice that they would be hmms permanent and not just a tag if that makes sense. LIke the actual Hebrew or text inside would get reversed as needed.

Re: HTML import and RTL

Posted: Tue Mar 14, 2023 7:20 pm
by Sergey Tkachenko
TRichView does not support <bdo> because it does not support this type of specifying text direction.

<bdo> specifies text direction ignoring bidirectional properties of text. You can use <bdo> to display English text RTL:

Code: Select all

<bdo dir="rtl">Text</bdo>
displays:
txeT
You cannot do the same in TRichView. In TRichView, you can only define the default text direction that affects bidi-neurtal characters but does not affect characters with strong bi-di properties.
Also, TRichView does not support multiple bidi levels.
In TRichView, you can define BiDiMode for text and paragraph, specifying the default direction in a paragraph or in a text fragment. HTML analog is CSS direction property.
Currently, this property is saved in HTML, but is not loaded. It will be implemented in the next TRichView update.

Re: HTML import and RTL

Posted: Tue Mar 14, 2023 8:03 pm
by jgkoehn
So in the next update it would come in as reversed then? Also would it work on Hebrew? This is more complex due to vowel points as you know.

Perhaps a better question what would it look like once the update happens?

Re: HTML import and RTL

Posted: Wed Mar 15, 2023 7:59 am
by Sergey Tkachenko
In the next update, I plan to import CSS direction property in BiDiMode property of text and paragraphs. This property defines the default text direction in a text fragment or a paragraph.
No other bidi-related changes are planned.
TRichView always displays Hebrew text RTL, and English text LTR. This property affects neutral characters, like punctuation. Also, paragraph's BiDiMode affects position of list markers (at the right side for RTL paragraphs).

Re: HTML import and RTL

Posted: Wed Mar 15, 2023 1:08 pm
by jgkoehn
Thanks for the information!