Bug 63847 - TOC page number sometimes rendered in RTL font if last heading character is RTL
Summary: TOC page number sometimes rendered in RTL font if last heading character is RTL
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.2.2 release
Hardware: Other All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: RTL-CTL TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2013-04-23 15:56 UTC by Erwan
Modified: 2023-02-10 19:22 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test case for page number in TOC with "CTL text" attributes (57.62 KB, application/vnd.oasis.opendocument.text)
2013-04-23 15:56 UTC, Erwan
Details
pdf export of odf file (made with ghostscript) (77.38 KB, application/pdf)
2013-04-23 15:57 UTC, Erwan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erwan 2013-04-23 15:56:15 UTC
Created attachment 78378 [details]
test case for page number in TOC with "CTL text" attributes

In a LTR document with a few RTL character, if the last character of a heading is a RTL character, then the page number in the table of contents will use the "CTL font" attributes of the "content style" insted of the "Western text font" attributes.
I usually write in French or English with a 12 pt font, adding a few Hebrew words in a 16 pt font, to make the Hebrew text easier to read. I set it by specifying different attributes for "Western text font" and "CTL font" in the style reference. When I switch from English to Hebrew keyboard layout, LibreOffice automatically switches font and style. That's great !
Now if the last character of a heading is in Hebrew, LibreOffice will consider that the page number in the Table of Contents is also in Hebrew, and will apply the "CTL font" attributes... I will get my hebrew font in 16 pt, instead of my western font in 12 pt.

An easy workaround is to add the invisible character "Left-to-Right mark" (from menu Insert/Formatting mark) as last character of the heading.
Comment 1 Erwan 2013-04-23 15:57:23 UTC
Created attachment 78379 [details]
pdf export of odf file (made with ghostscript)
Comment 2 Urmas 2013-04-24 15:44:51 UTC
Confirmed in 4.0.3.
Comment 3 QA Administrators 2015-04-19 03:22:38 UTC Comment hidden (obsolete)
Comment 4 Buovjaga 2015-06-18 15:08:03 UTC
Still confirmed.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 437210d58f32177ef1829d704f7f4d2f1bbfbfdd
TinderBox: Win-x86@39, Branch:master, Time: 2015-06-18_07:21:56
Locale: fi-FI (fi_FI)
Comment 5 QA Administrators 2016-09-20 10:10:56 UTC Comment hidden (obsolete)
Comment 6 Lior Kaplan 2017-10-12 10:51:22 UTC
Still happens in 5.4.1.
Comment 7 Omer Zak 2017-11-03 11:39:12 UTC
Still happens in:

Version: 5.4.2.2.0+
Build ID: 1:5.4.2-3~bpo9+1
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.utf8); Calc: group

OS: Debian 64bit Stretch (Debian 9.2, with some backported packages)
Comment 8 Eyal Rozenberg 2018-09-17 17:18:41 UTC
Bug still manifests with:

Version: 6.1.1.2
Build ID: 5d19a1bfa650b796764388cd8b33a5af1f5baa1b
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk2; 
Locale: en-GB (en_GB.UTF-8); Calc: group threaded
Comment 9 QA Administrators 2019-09-18 02:53:57 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2021-09-18 03:27:06 UTC Comment hidden (obsolete)
Comment 11 Eyal Rozenberg 2023-02-10 19:21:50 UTC
Bug still manifests with 

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ad387d5b984c6666906505d25685065f710ed55d
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US