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)
(earliest affected)
3.5.0 release
Hardware: All All
: medium minor
Assignee: Not Assigned
Depends on:
Blocks: RTL-CTL User-Locale
  Show dependency treegraph
Reported: 2017-03-03 20:58 UTC by Hossein
Modified: 2023-09-24 20:25 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

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

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
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

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
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
I can reproduce the bug with Version: 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

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: (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)

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: / 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: / 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.