B4A Library [B4X] BCTextEngine / BBCodeView - Text engine + BBCode parser + Rich Text View

Status
Not open for further replies.

William Lancee

Well-Known Member
Licensed User
Longtime User
I should say it fixes one problem. You also have chr(13) and other characters which cause problems. These are typical for web downloads.
Chr(65297) is "ZERO WIDTH NO-BREAK SPACE". Spaces after EOL indent the paragraph, but the INDENT tag is a better way to do it.

The following tidies your text nicely. My eagle eyes still detect a inconsistent vertical space between lines (due to accents?) that the master
may want to address.

B4X:
MyText = MyText.Replace(Chr(160), Chr(32)).Replace(Chr(13), "").Replace(Chr(12), "").Replace(Chr(65297), "").Replace(Chr(10) & "   ", Chr(10))
 

William Lancee

Well-Known Member
Licensed User
Longtime User
@Erel

The log shows some numbers at the end that are not requested. They don't have an arrow, so perhaps a log statement in the class?
 

js486dog

Active Member
Licensed User
Longtime User
Thank you very much William.
But the question for me is ?
Why should I use version 1.73 when 1.72 is better for my purpose. I do not need to use "Replace" in version 1.62.
 

js486dog

Active Member
Licensed User
Longtime User
Thank you very much William. This one works fine.
 

reijox

Member
Licensed User
Longtime User
Hi,
i have a BBCodeView.Text where i load some large .txt.
if the txt is high, i have to desplace text with finger till down (obviously).
after, i load another large .txt but the text does not appear from the beginning. its seems like the vertical possition still memorized.
how can i set that vertical possition to top?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
- v1.86 - Initial support for right to left languages. The plan was to add support for Hebrew and Arabic languages, however Arabic is significantly more complicated (due to the complex joining rules), so for now only Hebrew is supported.

The complexity of supporting right to left languages isn't related to the text going from right to left. This is very similar to text going from left to right. The complexity is related to the text being bi-directional. Numbers and other non-Hebrew letters should be kept left to right.

The RTL features are enabled when BBCodeView / BBlabel.RTL is set to True.

B4X:
'The following string is correct although it doesn't look like that in the browser or IDE (the document text flow direction needs to be set to RTL):
s = $"שמי אראל ואני תכנת B4X"$
BBCodeView1.RTL = False 'default
BBCodeView1.Text = $"[alignment=right]${s}[/alignment]"$

You will need to believe me that the result is (very) bad:



With the new RTL feature:
B4X:
BBCodeView1.RTL = True

Good result:



The engine tries to detect the correct direction of each word. It decides based on the first letter.

In some cases we need to help it with the new 'direction' tag:
B4X:
s = $"שמי אראל ואני מתכנת ב[direction=ltr]B4X[/direction]."$



The direction tag accepts 3 values: ltr, rtl and unknown.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
- v1.87 - BBCodeView - Links are underlined automatically when the user moves the cursor or presses on the link. Note that it is only enabled when lazy loading is enabled.
Example was updated and it is now based on B4XPages. B4i - There is an important inline OBJC code in example that you should add to prevent unwanted URL clicks when the user scrolls the BBCodeView.

 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…