View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0014806 | Scribus | NLS | public | 2017-05-20 03:30 | 2026-05-03 11:28 |
| Reporter | munzirtaha | Assigned To | Fahad | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Platform | Linux | OS | Arch Linux | OS Version | latest |
| Product Version | 1.5.3.svn | ||||
| Fixed in Version | 1.7.4.svn | ||||
| Summary | 0014806: [PATCH] RTL interface glitches: cuts off the beginning of the Arabic-translated menus and wrong % direction | ||||
| Description | The right margin of the Arabic text eats some characters off the Arabic menus. e.g the highlighted entry in the screenshot has two characters missing. Also, the zoom ratio shows as 100% where it should show as %100 for RTL | ||||
| Tags | RTL, RTLGUI | ||||
| Attached Files | |||||
| Patch | Yes | ||||
|
|
I can't produce it anymore I am using scribus 1.6.6 & Fedora 43 |
|
|
In the screenshot, the Zoom ratio still looks inverted. But I can't really read it, so it's up to you to give the OK or not : - ) |
|
|
Thanks ale to the catch. In this regard, The % symbol is a "neutral" (or "weak") character in the Unicode Bidirectional (BiDi) algorithm. Because it doesn't have an inherent direction (unlike Arabic letters which are Right-to-Left or Latin letters which are Left-to-Right), the rendering engine often defaults to the application's base direction or gets confused when mixed with numbers in an RTL context. To force the correct rendering, you need to use a Unicode BiDi Control Character to tell the engine to treat the string as Right-to-Left. I've prepared a patch to fix it. fix_14806.patch (1,253 bytes)
Subject: [PATCH] fix 14806
---
Index: scribus/scribus.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/scribus/scribus.cpp b/scribus/scribus.cpp
--- a/scribus/scribus.cpp (revision 27539)
+++ b/scribus/scribus.cpp (date 1777602691309)
@@ -1429,7 +1429,16 @@
zoomSpinBox->setValue( 100 );
zoomSpinBox->setSingleStep(10);
zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
- zoomSpinBox->setSuffix( tr( " %" ) );
+ // Determine the current text direction based on the GUI language setting
+ const auto direction = QLocale(ScCore->getGuiLanguage()).textDirection();
+ // If in RTL mode, wrap the suffix in RLE (Right-to-Left Embedding \u202B)
+ // and PDF (Pop Directional Formatting \u202C) control characters.
+ // This forces the rendering engine to treat the suffix as an isolated RTL block,
+ // preventing neutral characters like '%' from causing layout issues.
+ const auto suffix = (direction == Qt::RightToLeft)
+ ? QStringLiteral("\u202B %\u202C")
+ : QStringLiteral(" %");
+ zoomSpinBox->setSuffix(suffix);
layerMenu = new QComboBox( this );
layerMenu->setObjectName("layerMenu");
layerMenu->setEditable(false);
|
|
|
This doesn't work for me Fahad, when I select ar UI language. |
|
|
The % issue is a Qt bug I submitted in 2011 ;) https://qt-project.atlassian.net/browse/QTBUG-22623 |
|
|
Hi Craige, I missed that when the language changed QSpinBox should rebuild again. I've updated the patch to reflect that. fix_#14806_v2.patch (2,288 bytes)
Subject: [PATCH] fix #14806 v2
---
Index: scribus/scribus.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/scribus/scribus.cpp b/scribus/scribus.cpp
--- a/scribus/scribus.cpp (revision 27539)
+++ b/scribus/scribus.cpp (date 1777720470764)
@@ -1429,7 +1429,7 @@
zoomSpinBox->setValue( 100 );
zoomSpinBox->setSingleStep(10);
zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
- zoomSpinBox->setSuffix( tr( " %" ) );
+ updateZoomSuffix();
layerMenu = new QComboBox( this );
layerMenu->setObjectName("layerMenu");
layerMenu->setEditable(false);
@@ -7380,6 +7380,19 @@
}
}
+void ScribusMainWindow::updateZoomSuffix()
+{
+ // Determine the current text direction based on the GUI language setting
+ const auto direction = QLocale(ScCore->getGuiLanguage()).textDirection();
+ // If in RTL mode, wrap the suffix in RLE (Right-to-Left Embedding \u202B)
+ // and PDF (Pop Directional Formatting \u202C) control characters.
+ // This forces the rendering engine to treat the suffix as an isolated RTL block,
+ // preventing neutral characters like '%' from causing layout issues.
+ const auto suffix = (direction == Qt::RightToLeft)
+ ? QStringLiteral("\u202B %\u202C")
+ : QStringLiteral(" %");
+ zoomSpinBox->setSuffix(suffix);
+}
void ScribusMainWindow::gotoLayer(int l)
{
@@ -8555,6 +8568,7 @@
void ScribusMainWindow::statusBarLanguageChange()
{
+ updateZoomSuffix();
zoomSpinBox->setToolTip( tr("Current zoom level"));
zoomDefaultToolbarButton->setToolTip( tr("Zoom to 100%"));
zoomOutToolbarButton->setToolTip( tr("Zoom out by the stepping value in Tools preferences"));
Index: scribus/scribus.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/scribus/scribus.h b/scribus/scribus.h
--- a/scribus/scribus.h (revision 27539)
+++ b/scribus/scribus.h (date 1777720364656)
@@ -185,6 +185,7 @@
void RestoreBookMarks();
QStringList scrapbookNames() const;
void updateLayerMenu();
+ void updateZoomSuffix();
void emergencySave();
QStringList findRecoverableFile();
bool recoverFile(const QStringList& foundFiles);
|
|
|
|
|
|
After the latest patch... |
|
|
I see now, well The problem is that Western Arabic numerals (0-9) are technically "Strong LTR" characters in the Unicode standard, while Eastern Arabic numerals are RTL. There is no consensus where to put the % with Arabic numerals. Sometimes it is put on the right sometimes on the left. You can see this behavior in MS Office Arabic interface. However, I update my patch to deal with Arabic numerals . I hope it works without problem. fix_#14806_v3.patch (2,299 bytes)
Subject: [PATCH] fix #14806 v3
---
Index: scribus/scribus.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/scribus/scribus.cpp b/scribus/scribus.cpp
--- a/scribus/scribus.cpp (revision 27539)
+++ b/scribus/scribus.cpp (date 1777807187053)
@@ -1429,7 +1429,7 @@
zoomSpinBox->setValue( 100 );
zoomSpinBox->setSingleStep(10);
zoomSpinBox->setFocusPolicy(Qt::ClickFocus);
- zoomSpinBox->setSuffix( tr( " %" ) );
+ updateZoomSuffix();
layerMenu = new QComboBox( this );
layerMenu->setObjectName("layerMenu");
layerMenu->setEditable(false);
@@ -7380,6 +7380,22 @@
}
}
+void ScribusMainWindow::updateZoomSuffix()
+{
+ // Determine the current text direction based on the GUI language setting
+ const auto direction = QLocale(ScCore->getGuiLanguage()).textDirection();
+ // Use RLM (\u200F) in RTL mode to anchor the '%' symbol,
+ // ensuring correct placement regardless of Latin or Arabic numeral types.
+ const auto suffix = (direction == Qt::RightToLeft)
+ ? QStringLiteral("\u200F %")
+ : QStringLiteral(" %");
+ zoomSpinBox->setSuffix(suffix);
+ if (direction == Qt::RightToLeft) {
+ zoomSpinBox->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
+ } else {
+ zoomSpinBox->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
+ }
+}
void ScribusMainWindow::gotoLayer(int l)
{
@@ -8555,6 +8571,7 @@
void ScribusMainWindow::statusBarLanguageChange()
{
+ updateZoomSuffix();
zoomSpinBox->setToolTip( tr("Current zoom level"));
zoomDefaultToolbarButton->setToolTip( tr("Zoom to 100%"));
zoomOutToolbarButton->setToolTip( tr("Zoom out by the stepping value in Tools preferences"));
Index: scribus/scribus.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/scribus/scribus.h b/scribus/scribus.h
--- a/scribus/scribus.h (revision 27539)
+++ b/scribus/scribus.h (date 1777720364656)
@@ -185,6 +185,7 @@
void RestoreBookMarks();
QStringList scrapbookNames() const;
void updateLayerMenu();
+ void updateZoomSuffix();
void emergencySave();
QStringList findRecoverableFile();
bool recoverFile(const QStringList& foundFiles);
|
|
|
Thanks, fixed and applied |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2017-05-20 03:30 | munzirtaha | New Issue | |
| 2017-05-20 03:30 | munzirtaha | File Added: scribus-bug.png | |
| 2017-05-20 03:30 | munzirtaha | Tag Attached: RTL | |
| 2017-05-20 03:30 | munzirtaha | Tag Attached: RTLGUI | |
| 2026-04-30 07:58 | Fahad | Note Added: 0053633 | |
| 2026-04-30 07:58 | Fahad | File Added: screenshot.png | |
| 2026-04-30 14:49 | ale | Note Added: 0053634 | |
| 2026-05-01 02:40 | Fahad | Note Added: 0053635 | |
| 2026-05-01 02:40 | Fahad | File Added: fix_14806.patch | |
| 2026-05-01 07:00 | ale | Summary | RTL interface glitches: cuts off the beginning of the Arabic-translated menus and wrong % direction => [PATCH] RTL interface glitches: cuts off the beginning of the Arabic-translated menus and wrong % direction |
| 2026-05-01 07:00 | ale | Patch | No => Yes |
| 2026-05-01 13:40 | cbradney | Note Added: 0053640 | |
| 2026-05-01 22:07 | munzirtaha | Note Added: 0053641 | |
| 2026-05-02 11:23 | Fahad | Note Added: 0053642 | |
| 2026-05-02 11:23 | Fahad | File Added: fix_#14806_v2.patch | |
| 2026-05-03 10:12 | cbradney | Note Added: 0053647 | |
| 2026-05-03 10:12 | cbradney | File Added: image.png | |
| 2026-05-03 10:12 | cbradney | Note Added: 0053648 | |
| 2026-05-03 11:20 | Fahad | Note Added: 0053649 | |
| 2026-05-03 11:20 | Fahad | File Added: fix_#14806_v3.patch | |
| 2026-05-03 11:28 | cbradney | Assigned To | => Fahad |
| 2026-05-03 11:28 | cbradney | Status | new => resolved |
| 2026-05-03 11:28 | cbradney | Resolution | open => fixed |
| 2026-05-03 11:28 | cbradney | Fixed in Version | => 1.7.4.svn |
| 2026-05-03 11:28 | cbradney | Note Added: 0053650 |