Bug 106307 - Wrong shape for numerals, based on locale and not the text language
Summary: Wrong shape for numerals, based on locale and not the text language
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: User-Locale Languages
  Show dependency treegraph
 
Reported: 2017-03-03 20:58 UTC by Hossein
Modified: 2024-08-02 20:35 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshots of different Hindi fonts numerals (188.18 KB, application/pdf)
2020-06-01 17:01 UTC, Mike
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2017-03-03 20:58:29 UTC
Description:
I am a Persian/Farsi user, and I usually work with Persian/Farsi language documents. Because of this, I use "Persian" locale in Libreoffice.
Now that I want to open an English language Impress document, from LO 5.3 I see numerals in Hindi, although I have selected "context" in Options > Language Settings > Complex Text Layout > General Options > Numerals.

Steps to Reproduce:
1. Set locale to Persian in Options > Language Settings > Languages > Locale setting
2. Set "Numerals" to "context" in Options > Language Settings > Complex Text Layout > General Options.
3. Open or create some Impress presentation with English text and numerals.

Actual Results:  
Numerals are shown in Hindi, like ۱, ۲, ۳, etc., which is wrong.

Expected Results:
Numerals should be shown in Arabic, like 1, 2, 3, etc.


Reproducible: Always

User Profile Reset: No

Additional Info:
This seems to be created in LibreOffice 5.3, which fixed a lot of  text rendering issues. The locale prolbems are not confined to this issue. Here is another one:

Bug 106306 - Wrong text language detection, based on locale and not keyboard
https://bugs.documentfoundation.org/show_bug.cgi?id=106306


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0
Comment 1 Buovjaga 2017-03-11 18:27:35 UTC
Reproduced. The entered numerals turn Hindi after clicking out of the text box.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: 43af3605d7e3b372dcc61f9cbc2cabff09396ed5
CPU threads: 8; OS: Linux 4.10; UI render: default; VCL: kde4; 
Locale: fa-IR (fi_FI.UTF-8); Calc: group
Built on March 10th 2016
Comment 2 raal 2017-05-26 13:50:01 UTC
Hello,
I can reproduce the bug with Version: 4.4.0.0.alpha0+. Is it really regression? Hossein, from which version did you upgraded to 5.3?
Comment 3 Buovjaga 2017-07-04 08:57:03 UTC
Yep, the regression claim was bogus. I see the behaviour in 3.5 already. There the locale is still named "Farsi".

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 4 QA Administrators 2018-07-05 02:49:06 UTC Comment hidden (obsolete)
Comment 5 Mike 2020-06-01 16:59:37 UTC
repro

Version: 6.4.2.2
Build ID: 1:6.4.2-0ubuntu3
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-US (de_DE.UTF-8); UI-Language: en-US
Calc: threaded

Version: 6.4.4.2 (x64)
Build-ID: 3d775be2011f3886db32dfd395a6a6d1ca2630ff
CPU-Threads: 4; BS: Windows 10.0 Build 18363; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: CL

There are other things to this issue

A) Additionally to Persian do some other locales that switch to Hindi numerals:
Arabic (all locales)
Urdu (Pakistan)
Punjabi

I don't know what they have in common except being in the same area [middle east and north africa].
(I did not test all locales, just some.)

B) Impress uses different fonts for Hindi numerals. If you open the settings and change the locale from "Persian" to "Hindi", the numeral's font changes. Impress chooses another font. This affects both Win and Ubuntu.
Comment 6 Mike 2020-06-01 17:01:41 UTC
Created attachment 161499 [details]
Screenshots of different Hindi fonts numerals
Comment 7 Hossein 2022-05-04 08:08:31 UTC
Still reproducible in 7.3 and the latest 7.4 master:

Version: 7.3.0.3 / LibreOffice Community
Build ID: 0f246aa12d0eee4a0f7adcefbf7c878fc2238db3
CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 0a415b92d3c1ea2c5befd30b4ac29442f422a41d
CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: fa-IR (en_US.UTF-8); UI: en-US
Calc: threaded

The problem is visible when the "Numerals" is set to "Context". So, one should take a look at the code that handles this option.
Comment 8 Eyal Rozenberg 2024-07-22 21:56:46 UTC
Well, there is the "little" problem of LO not actually supporting the setting of a language... see bug 148257: One can set a language with the language-group, but not the language group; and even that is part of the styling of the text, not the content. So if you apply another character style, you could get a different language supposedly.
Comment 9 Eyal Rozenberg 2024-08-02 20:35:13 UTC
Changed blocker since the issue here isn't the direction (RTL/CTL), nor even the fact that Arabic has complex text layout. (This could well be happening with one of the Thai language and the choice between western-Arabic and traditional Thai numerals).