https://bugs.kde.org/show_bug.cgi?id=524125

            Bug ID: 524125
           Summary: Add explicit RTL and LTR text direction buttons to the
                    Text Section
    Classification: Applications
           Product: drawy
      Version First unspecified
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: user-interface
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Currently, Drawy automatically tries to guess text direction. While this works
for simple English or simple Arabic text, it fails whenever text includes mixed
languages, numbers, brackets, or punctuation at the end of sentences.

Adding explicit RTL and LTR buttons to the text toolbar allows users to
manually set the correct text direction, fixing broken layouts in right-to-left
languages (like Arabic, Hebrew, Persian, and Urdu).
Why Auto-Direction Fails (The Problem)

In text processing, characters are categorized as:
1. Strong characters: Regular letters (e.g., English A-Z or Arabic letters).
2. Weak characters: Numbers (0-9), phone numbers, and dates.
3. Neutral characters: Spaces, punctuation (!, ?, .), and brackets (), [].

Without explicit RTL/LTR buttons, the editor relies on auto-detection. When
weak or neutral characters sit at the start or end of a sentence, the automatic
system miscalculates where the sentence starts and ends.

Visual Examples of Broken Text Layouts
(Note: In the examples below, [START] indicates where reading begins and [END]
indicates where the punctuation should land).
1. Wrong Punctuation Placement (Exclamation Marks, Periods)
    Intended text:
    مرحبا بك في Drawy!
    [START] (Arabic words) Drawy! [END]

    What happens in broken auto-mode:
    The exclamation mark ! gets placed at the far right (before the sentence)
instead of the far left (after the sentence).

    Visual result in broken mode:
    ![Arabic words] Drawy

2. Broken Brackets ()
    Intended text:
    (تجربة)
    [Open Parenthesis] [Arabic Text] [Close Parenthesis]

    What happens in broken auto-mode:
    Brackets fail to mirror properly. The closing parenthesis displays inverted
at the wrong end.

    Visual result in broken mode:
    ) [Arabic Text] (

3. Sentences Starting with Numbers

    Intended text:
    2026 هي السنة الحالية.
    2026 [Arabic Text].

    What happens in broken auto-mode:
    Because 2026 is a number (weak character), the auto-detection assumes LTR
mode, aligning the whole paragraph to the left and placing the period at the
wrong end.

Requested Solution
Add two toggle buttons to the Text Formatting Toolbar:
   1.  RTL Button: Forces the selected text block to read from Right-to-Left
(and aligns text to the right by default).
   2.  LTR Button: Forces the selected text block to read from Left-to-Right
(and aligns text to the left by default).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to