Bug 154893 - Generated number in a caption is rendered using CJK font for no reason
Summary: Generated number in a caption is rendered using CJK font for no reason
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: RTL-CTL Caption
  Show dependency treegraph
 
Reported: 2023-04-18 21:18 UTC by Eyal Rozenberg
Modified: 2023-10-14 10:43 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Document with image and caption inserted, RTL and LTR caption paragraph directions (15.84 KB, image/png)
2023-04-18 21:18 UTC, Eyal Rozenberg
Details
Document with image and caption (12.88 KB, application/vnd.oasis.opendocument.text)
2023-04-18 21:19 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2023-04-18 21:18:29 UTC
Created attachment 186766 [details]
Document with image and caption inserted, RTL and LTR caption paragraph directions

Reproduction instructions:

1. Create a new Writer document (where my template has default page style and paragraph style be RTL)
2. Insert an image
3. Right-click it
4. "Insert Caption..."
5. Write some caption text in English
6. Select Arabic numbering

I EXPECT to get an arabic-number 1, in the Western language font. _maybe_ in the RTL/CTL language font because the caption paragraph is RTL, although that would be a bit weird seeing how the category name is in English.

I GET an arabic-number 1 - but in none of the fonts I am supposedly using (David CLM, Liberation Serif, CJK Noto Serif JP). It's kind of an ornamental twisted font, not something you'd use for body text.

If I change the caption paragraph's direction to LTR, the number is rendered in a decent font.

See attached screenshots.



Version info:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b5c3a7502f7ff6ccf0f829c1f3a2ba50b8584c41
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US
Calc: threaded
Comment 1 Eyal Rozenberg 2023-04-18 21:19:12 UTC
Created attachment 186767 [details]
Document with image and caption

This document has an image and a caption (also a border around them, but that doesn't matter). It was used to generate the screenshots.
Comment 2 Dieter 2023-05-06 13:29:32 UTC
I confirm it with

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 69d0be09ad81935f7da4b6f8d036c3562357d068
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-GB
Calc: CL threaded

But it is not only related to captions. Just open attached file, write some text and add page number => same result.
Comment 3 Buovjaga 2023-05-10 13:28:07 UTC
I guess it is not the underlying reason, but the font changes in version 6.0 with 85e2a27409f184c8504e61163dc741a31ccc5186
tdf#113538 Add Hebrew fonts into default installation
Comment 4 ⁨خالد حسني⁩ 2023-06-05 12:38:31 UTC
(In reply to Eyal Rozenberg from comment #0)
> I EXPECT to get an arabic-number 1, in the Western language font. _maybe_ in
> the RTL/CTL language font because the caption paragraph is RTL, although
> that would be a bit weird seeing how the category name is in English.
> 
> I GET an arabic-number 1 - but in none of the fonts I am supposedly using
> (David CLM, Liberation Serif, CJK Noto Serif JP). It's kind of an ornamental
> twisted font, not something you'd use for body text.

For me it i using the CTL (Hebrew) font, the italic style (whose 1 looks funny).
Comment 5 ⁨خالد حسني⁩ 2023-06-05 12:42:45 UTC
(In reply to ⁨خالد حسني⁩ from comment #4)
> (In reply to Eyal Rozenberg from comment #0)
> > I EXPECT to get an arabic-number 1, in the Western language font. _maybe_ in
> > the RTL/CTL language font because the caption paragraph is RTL, although
> > that would be a bit weird seeing how the category name is in English.
> > 
> > I GET an arabic-number 1 - but in none of the fonts I am supposedly using
> > (David CLM, Liberation Serif, CJK Noto Serif JP). It's kind of an ornamental
> > twisted font, not something you'd use for body text.
> 
> For me it i using the CTL (Hebrew) font, the italic style (whose 1 looks
> funny).

And if I change the paragraph direction to LTR, it uses the Western font.

The same happens to paragraph text that is composed of numbers only.

My guess is that fields are processed standalone, so the surrounding English text is not seen, and it is treated like standalone numbers in a RTL paragraph which gets classified as CTL text.
Comment 6 Eyal Rozenberg 2023-09-30 14:56:44 UTC
(In reply to Dieter from comment #2)
> But it is not only related to captions. Just open attached file, write some
> text and add page number => same result.

I don't experience this if I write some text and add page numbers. At least - not with 

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f8e591ab9182e0a61c4ae5b8f77b166fcaeaa877
CPU threads: 4; OS: Linux 6.4; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US
Comment 7 Dieter 2023-10-14 10:43:47 UTC
(In reply to Eyal Rozenberg from comment #6)
 I don't experience this if I write some text and add page numbers.

Couldn't reproduce it also. Can't explain.