Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right-to-Left languages characters in each label words are reversed #54098

Closed
2 tasks done
hareldunn opened this issue Aug 6, 2023 · 43 comments
Closed
2 tasks done

Right-to-Left languages characters in each label words are reversed #54098

hareldunn opened this issue Aug 6, 2023 · 43 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers Labeling Related to QGIS map labeling Languages support Regression Something which used to work, but doesn't anymore stale Uh oh! Seems this work is abandoned, and the PR is about to close.

Comments

@hareldunn
Copy link
Contributor

What is the bug or the crash?

This is a recurrence of a bug similar fixed long ago for all rtl languages like Hebrew, Persian and Arabic. It was solved, at times, with using the curved label option, but not any more.

Each word, although in correct word order, has it's letters reversed, akin to:
Hello World -> olleH dlroW

Here's the bad labelling in 3.32, note for example the word for chapel קפלה is displayed in reverse הלפק
image

Here's the correct text handling in 3.28.9 LTR
image

Steps to reproduce the issue

Add any layer with RTL language in attribute table
Display label based on field

Or open QGZ from GPGK here
qgisbug.zip

I've added English, Arabic and Hebrew labels from the OSM amenity data

Versions

3.32.1

QGIS version 3.32.1-Lima QGIS code revision 4a078ec
Qt version 5.15.3
Python version 3.9.5
GDAL/OGR version 3.7.1
PROJ version 9.2.1
EPSG Registry database version v10.088 (2023-05-13)
GEOS version 3.12.0-CAPI-1.18.0
SQLite version 3.41.1
PDAL version 2.5.5
PostgreSQL client version unknown
SpatiaLite version 5.1.0
QWT version 6.1.6
QScintilla2 version 2.13.1
OS version Windows 10 Version 2009
QGIS version 3.32.1-Lima QGIS code revision [4a078ec](https://github.com/qgis/QGIS/commit/4a078ecf) Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.7.1 PROJ version 9.2.1 EPSG Registry database version v10.088 (2023-05-13) GEOS version 3.12.0-CAPI-1.18.0 SQLite version 3.41.1 PDAL version 2.5.5 PostgreSQL client version unknown SpatiaLite version 5.1.0 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

It appears the change happened between 3.30 and 3.32, a colleague had his computer replaced and installed a new QGIS version 3.32 standalone that showed this issue. I guided him with installing the network installer for 3.32 and had the same issue. I tested his project and layers on my computer, and it too showed the bug in 3.32, but not in 3.28 LTR. He claims his project worked fine in his old computer running 3.30, so this pinpoints the bug to 3.30 -> 3.32

@hareldunn hareldunn added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Aug 6, 2023
@agiudiceandrea agiudiceandrea added Labeling Related to QGIS map labeling Regression Something which used to work, but doesn't anymore and removed Regression Something which used to work, but doesn't anymore labels Aug 6, 2023
@agiudiceandrea
Copy link
Contributor

Hi @hareldunn, thanks for reporting. Could you please specify the difference between the issue you reported and the one reported at #21940? In the #21940 issue report, users claim that the issue occurs also in QGIS 3.28 and QGIS 3.30 and previous version.
Could you please clarify what do you mean with "Each word, although in correct word order, has it's letters reversed" as it seems to me in the provided images the entire label is reversed, not only the letters of the single words.

@agiudiceandrea agiudiceandrea added the Feedback Waiting on the submitter for answers label Aug 6, 2023
@hareldunn
Copy link
Contributor Author

Hi @agiudiceandrea, you are correct, I somehow managed to confuse myself.
Yes, the flip is indeed for the entire label string, "Hello World" -> "dlroW olleH"

As for recent QGIS version, I didn't have that issue, nor did my colleague, only in 3.32.

I also found another mention of this on GIS.SE, seems to be the same issue

@agiudiceandrea agiudiceandrea removed the Feedback Waiting on the submitter for answers label Aug 15, 2023
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Aug 15, 2023

Hi @hareldunn, thanks for checking. I cannot replicate the issue neither using QGIS 3.28, QGIS 3.30 nor QGIS 3.33-master: it seems to me the labels are correctly displayed.

See the exported images of point from "amenity Hebrew" layer with "full_id" field value of n2954804553:

QGIS 3.28
3_28

QGIS 3.30
3_30

QGIS 3.33-master
master

Maybe the issue has been already fixed in development branch: you can install a development version using a standalone installer available at https://download.osgeo.org/qgis/windows/weekly/?C=M&O=D.

@micha-silver
Copy link

I can confirm this issue on Windows, QGIS 3.32.3.
We reverted to 3.28.11 and the backwards RTL text problem does not appear
(Also, the problem does not appear on Linux, with the same QGIS version)

@agiudiceandrea
Copy link
Contributor

@micha-silver , thanks for reporting. Could you please provide a simple project and a simple layer with only one feature in order to replicate the issue?

@drarbib
Copy link

drarbib commented Nov 9, 2023

Hi I have the same issue, working on windows 10. and it's been persistent since above gis 3.30.0, including the recent 3.34. It's not only that the letter order is reversed it's also outside the label box

Here's a screenshot using 3.34:
image

But when I revert to 3.30.0, it displays correct:
image

As you can see numbers are displayed correctly

@agiudiceandrea
Copy link
Contributor

@drarbib, thanks for reporting. Could you please provide a simple project and a simple layer with only one or few features in order to replicate the issue? Could you please specify the OS locale / language and the locale / language set in QGIS?

@agiudiceandrea agiudiceandrea added the Regression Something which used to work, but doesn't anymore label Nov 9, 2023
@drarbib
Copy link

drarbib commented Nov 9, 2023

RTL problem.zip

Hi, here's a simple file, created in 3.30.0, opened in 3.34 the problem is consistent. in fact even if i edit ans save it in 3.34 and open it in 3.30.0 it displays correct, but not in 3.34. THANK YOU

display in 3.30.0:
image

display in 3.34 (and 3.32.1 & 3.32.2)
image

windows:
Edition Windows 10 Pro
Version 20H2
Installed on ‎27/‎04/‎2021
OS build 19042.985
Serial number PF21WWN7
Experience Windows Feature Experience Pack 120.2212.2020.0

Locale:
QGIS settings:
image
windows settings:
image
image

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Nov 10, 2023

It looks like the issue doesn't occur on my Windows 10 Italian it_IT using QGIS 3.34.0

image

@agiudiceandrea agiudiceandrea added the Feedback Waiting on the submitter for answers label Nov 10, 2023
Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Nov 25, 2023
@agiudiceandrea agiudiceandrea removed Feedback Waiting on the submitter for answers stale Uh oh! Seems this work is abandoned, and the PR is about to close. labels Nov 25, 2023
@drarbib
Copy link

drarbib commented Nov 30, 2023

grazie mille Andrea, First off thank you for your time and effort. I just DLed and installed 3.34.1 and the issue persists (yet in 3.30 it works fine).
image

I do not know how I can help to resolve it. I am completely incompetent in programming. My common sense teIls me that somehow RTL support is created by an extra command that reverses the letter order, and maybe in my version of windows with Hebrew support it somehow does it double, whereas with your Italian one it does not. again what's weird to me is until 3.30 it never was a problem, so I wonder what was changed in the code. If there is anything I can do (like provide more system info) to help, please let me know

image

@agiudiceandrea
Copy link
Contributor

@drarbib, have you tried if the issue occurs also using a new QGIS user profile?

@drarbib
Copy link

drarbib commented Nov 30, 2023

I did just now on 3.34.0, problem persists + I know of another user on another computer who has this problem

@micha-silver
Copy link

Hi @agiudiceandrea
My (unchecked) idea is that the prob is a combination of Windows 11 and QGIS >= 3.30.
I could not see the problem in a Win 10 machine. And the issue does not appear on either version of Windows when QGIS <= 3.28. I have to ask some colleagues who have Win 11 to retest. I'll report back...

@ryangentry
Copy link

ryangentry commented Jan 2, 2024

I'd like to add any info that could be relevant, as I am also experiencing this bug. It did not exist sometime before 3.30. I am using 3.34 on Windows 11 and the problem still exists. On the photo below, look at Ramat HaSharon. The Hebrew and Arabic translations say "NorshHa Tamar", and plus the ه uses the initial form هـ, like it would if the word were displayed properly, even though it's at the end of the word, where the letter should look like ـه. The alignment here is set to "Center" but I can't get it to align the lines over one another like it worked in previous versions. I can add any other necessary info
Screenshot 2024-01-02 154001

@agiudiceandrea
Copy link
Contributor

@micha-silver , from the previous comments and from https://gis.stackexchange.com/questions/465205/left-to-right-flipped-names-in-arabic, it looks like the issue occurs on some systems both when using Windows 10 and Windows 11 with QGIS >= 3.32, and it didn't occur with QGIS 3.30.0 and previous versions.

@nyalldawson
Copy link
Collaborator

Is anyone able to supply a super simple, easy to understand demo project and data showing this issue? Simple enough so that the issue is clearly evident for someone with absolutely zero experience in right to left languages. Ideally with a mock-up of what the label should look like too.

I've tried to investigate this, but just lack understanding of exactly what's required here.

@nyalldawson nyalldawson added the Feedback Waiting on the submitter for answers label Feb 19, 2024
@ShieldsUpRedAlert
Copy link

ShieldsUpRedAlert commented Feb 25, 2024

@nyalldawson I don't know how QGIS handles RTL text internally, but as a user, Unicode RTL text (used to) appear RTL. You just align it to the right in the horizontal alignment (left/centre/right/justify) settings.

As far as I know, it is not dependent on system locale, and language settings. I did try adding the Dari (Persian) language and localisations on windows but did not fix the issue.

@ilyessmap
Copy link

  1. Open Automated placement engine
  2. Text rendering: select label as text

https://gis.stackexchange.com/a/477655/239933

@agiudiceandrea
Copy link
Contributor

@ilyessmap, thanks for sharing a workaround. It will likely also help to fix the issue.
@hareldunn @micha-silver @drarbib @ryangentry @ShieldsUpRedAlert may you please confirm the workaround works for you too?

@ShieldsUpRedAlert
Copy link

@agiudiceandrea, working for me in the main map window. In print layouts, the text is still mirrored on screen, but when I export as PDF everything looks fine.

@drarbib
Copy link

drarbib commented Feb 29, 2024

First off thank you @ilyessmap and thank you @agiudiceandrea,

like @ShieldsUpRedAlert the workaround works for me in the main window but not in the layouts

image
image

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Mar 3, 2024

@nyalldawson, here #56645 another issue report with a sample layer attached.
According to various reporters, the issue occurs if the "Text rendering" parameter (in the "Automated Placement Engine" dialog window) is set to "Always Render Labels as Paths (Recommended)" (which is the default).
If such parameter is set to "Always Render Labels as Text", then the label text is:

  • correctly displayed on the map canvas
  • not correctly displayed in the print layout
  • correctly displayed in the PDF file exported from the print layout

@nyalldawson
Copy link
Collaborator

@agiudiceandrea I still can't do anything with these reports yet, they all assume too much existing knowledge of how RTL languages work

Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Mar 18, 2024
@agiudiceandrea agiudiceandrea removed Feedback Waiting on the submitter for answers stale Uh oh! Seems this work is abandoned, and the PR is about to close. labels Mar 18, 2024
@ryangentry
Copy link

@nyalldawson, here #56645 another issue report with a sample layer attached. According to various reporters, the issue occurs if the "Text rendering" parameter (in the "Automated Placement Engine" dialog window) is set to "Always Render Labels as Paths (Recommended)" (which is the default). If such parameter is set to "Always Render Labels as Text", then the label text is:

  • correctly displayed on the map canvas
  • not correctly displayed in the print layout
  • correctly displayed in the PDF file exported from the print layout

This workaround works fine for the text, but text buffers are still displayed incorrectly. See:

image

@agiudiceandrea
Copy link
Contributor

See also: #57123.

@nyalldawson
Copy link
Collaborator

@agiudiceandrea can we readd the feedback label here? I still can't do anything with the information present in this report.

@agiudiceandrea agiudiceandrea added the Feedback Waiting on the submitter for answers label May 28, 2024
@bogind
Copy link

bogind commented Jun 3, 2024

Has been handled in any way?
Because using 3.34.6 on windows 11 I'm getting correct RTL rendering, with multiple fonts.

Adding my system info for comparison:

QGIS version 3.34.6-Prizren QGIS code revision 623828f
Qt version 5.15.13
Python version 3.12.3
GDAL/OGR version 3.8.5
PROJ version 9.4.0
EPSG Registry database version v11.004 (2024-02-24)
GEOS version 3.12.1-CAPI-1.18.1
SQLite version 3.45.1
PDAL version 2.6.3
PostgreSQL client version 16.2
SpatiaLite version 5.1.0
QWT version 6.2.0
QScintilla2 version 2.14.1
OS version Windows 11 Version 2009
       
Active Python plugins
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.6
processing 2.12.99

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jun 3, 2024

@bogindm thanks for reporting. Have you experienced the issue with previous QGIS versions on Windows? If yes, which one exactly and on which Windows version exactly?
AFAIK the issue has not been addressed on the QGIS side: see the thread at https://lists.osgeo.org/pipermail/qgis-developer/2024-May/066811.html

@drarbib
Copy link

drarbib commented Jun 3, 2024

i second @bogind findings, i just downloaded and used 3.36.3 Maidenhead and the problem is magically resolved even if I render the labels as paths
image

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jun 3, 2024

Hi @hareldunn @ryangentry @ilyessmap @ShieldsUpRedAlert @micha-silver, please check if the issue no longer occurs on your Windows systems using QGIS 3.36.3 or QGIS 3.34.7.

@nyalldawson
Copy link
Collaborator

It's an issue with curved labels only

@ShieldsUpRedAlert
Copy link

I just checked and confirm that the issue is no longer present for me on V3.36.3.

@micha-silver
Copy link

Sorry, but I see that the bug persists in 3.36.3. It only occurs, as @nyalldawson pointed out, when applying curved labels.
QGIS_3 36_RTL_small

@hareldunn
Copy link
Contributor Author

I had the same issue, as @micha-silver mentioned, earlier this week on a different machine with a fresh 3.36.3. Regular labels worked, curved didn't. Don't have a screenshot

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jun 6, 2024

The RTL issue in curved labels is a longstanding issue already reported about 10 years ago #21940 and not yet resolved, probably having a different root cause.

Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jun 21, 2024
Copy link

While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue.
Or, if you have any further questions, there are also further support channels that can help you.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers Labeling Related to QGIS map labeling Languages support Regression Something which used to work, but doesn't anymore stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

No branches or pull requests

9 participants