View Issue Details

IDProjectCategoryView StatusLast Update
0004803NoesisGUIC++ SDKpublic2026-02-19 00:10
ReporterDemond Assigned Tojsantos  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Product Version3.2.10 
Target Version3.2.11Fixed in Version3.2.11 
Summary0004803: Incorrect bracket positioning in RTL FlowDirection with RichText in TextBlock
Description

Description
When FlowDirection="RightToLeft" is applied to a TextBlock, Noesis renders paired brackets incorrectly. One of the brackets in a pair is visually reordered and appears on the wrong side of the text.

The issue is related to RTL (BiDi) reordering. RichText was used only to highlight parts of the text for demonstration purposes and is not the root cause of the problem.

Steps to Reproduce

  1. Create a TextBlock with FlowDirection="RightToLeft".
  2. Use noesis:RichText.Text with color tags and escaped bracketed text, for example:
    [color=Red]\[text1\][/color]
  3. Compare rendering with standard HTML behavior using dir="rtl".

Expected Result
Bracket pairs ([], (), {}, # #) should remain correctly positioned around the text in RTL layout, matching standard RTL behavior (e.g., HTML with dir="rtl").

Actual Result
One of the brackets in the pair is visually reordered and displayed on the wrong side of the text.

Additional Notes

  • The issue reproduces only when using FlowDirection="RightToLeft".
  • The same text renders correctly in web browsers with dir="rtl".
  • RichText was used only for color highlighting in the repro case and is not required to observe the issue.
  • The problem appears to be related to incorrect BiDi handling of neutral characters (paired delimiters) in RTL context.

Minimial code to reproduce:

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions"
    >
    <StackPanel Orientation="Vertical" FlowDirection="RightToLeft">
      <TextBlock Foreground="White" FontSize="20"
        noesis:RichText.Text="[color=Red]\[text1\][/color] [color=Green]\[text2\][/color] [color=Blue]\[text3\][/color] \[text4\] text5 text6"
      />
      <TextBlock Foreground="White" FontSize="20"
        noesis:RichText.Text="[color=Red]\[1:2:3\][/color] [color=Green]\[4:5:6\][/color] [color=Blue]\[text3\][/color] \[text4\] text5 text6"
      />
      <TextBlock Foreground="White" FontSize="20"
        noesis:RichText.Text="[color=Red](1:2:3)[/color] [color=Green](4:5:6)[/color] [color=Blue](text3)[/color] (text4) text5 text6"
      />
      <TextBlock Foreground="White" FontSize="20"
        noesis:RichText.Text="[color=Red]{1:2:3}[/color] [color=Green]{4:5:6}[/color] [color=Blue]{text3}[/color] {text4} text5 text6"
      />
      <TextBlock Foreground="White" FontSize="20"
        noesis:RichText.Text="[color=Red]#1:2:3#[/color] [color=Green]#4:5:6#[/color] [color=Blue]#text3#[/color] #text4# text5 text6"
      />
      <TextBlock Foreground="White" FontSize="20"
        noesis:RichText.Text="[color=Red]1:2:3[/color] [color=Green]4:5:6[/color] [color=Blue]text3[/color] text4 text5 text6"
      />
    </StackPanel>
</Grid>
PlatformAny

Relationships

related to 0004810 assignedsfernandez Hit test, caret and selection in TextBox with RightToLeft is on the left 

Activities

Demond

Demond

2026-02-13 09:17

reporter   ~0011886

Last edited: 2026-02-13 09:17

Top Web
Bottom Noesis

image.png (70,519 bytes)   
image.png (70,519 bytes)   
jsantos

jsantos

2026-02-13 11:45

manager   ~0011887

Last edited: 2026-02-13 11:46

Thanks for the excellent report. I’ve tested this behavior using WPF, and it behaves exactly the same as Noesis:

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
    <StackPanel Orientation="Vertical" FlowDirection="RightToLeft">
      <TextBlock Foreground="Black" FontSize="20"
        Text="[text1] [text2] [text3] [text4] text5 text6"
       />
      <TextBlock Foreground="Black" FontSize="20"
        Text="[1:2:3] [4:5:6] [text3] [text4] text5 text6"
      />
      <TextBlock Foreground="Black" FontSize="20"
        Text="(1:2:3) (4:5:6) (text3) (text4) text5 text6"
      />
      <TextBlock Foreground="Black" FontSize="20"
        Text="\{1:2:3\} \{4:5:6\} \{text3\} \{text4\} text5 text6"
      />
      <TextBlock Foreground="Black" FontSize="20"
        Text="#1:2:3# #4:5:6# #text3# #text4# text5 text6"
      />
      <TextBlock Foreground="Black" FontSize="20"
        Text="1:2:3 4:5:6 text3 text4 text5 text6"
      />
    </StackPanel>
</Grid>

We are currently using an old Unicode revision. Newer Unicode versions updated the rules for parentheses handling in bidirectional text, so this behavior should be fixed accordingly.

Issue History

Date Modified Username Field Change
2026-02-13 09:09 Demond New Issue
2026-02-13 09:10 Demond Description Updated
2026-02-13 09:12 Demond Description Updated
2026-02-13 09:14 Demond Description Updated
2026-02-13 09:14 Demond Description Updated
2026-02-13 09:15 Demond Description Updated
2026-02-13 09:15 Demond Description Updated
2026-02-13 09:17 Demond Note Added: 0011886
2026-02-13 09:17 Demond File Added: image.png
2026-02-13 09:17 Demond Note Edited: 0011886
2026-02-13 09:23 Demond Description Updated
2026-02-13 10:52 sfernandez Assigned To => jsantos
2026-02-13 10:52 sfernandez Status new => assigned
2026-02-13 10:52 sfernandez Target Version => 3.2.11
2026-02-13 11:45 jsantos Note Added: 0011887
2026-02-13 11:46 jsantos Note Edited: 0011887
2026-02-16 11:29 jsantos Relationship added related to 0004810
2026-02-19 00:10 jsantos Status assigned => resolved
2026-02-19 00:10 jsantos Resolution open => fixed
2026-02-19 00:10 jsantos Fixed in Version => 3.2.11