Bug 114087 - Unicode BiDi characters break font rendering
Summary: Unicode BiDi characters break font rendering
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.4.0.0.beta1
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Font-Rendering
  Show dependency treegraph
 
Reported: 2017-11-27 09:39 UTC by Volga
Modified: 2022-12-05 03:32 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Test file (10.17 KB, application/vnd.oasis.opendocument.text)
2017-11-27 09:40 UTC, Volga
Details
Snapshot (74.98 KB, image/png)
2017-11-27 09:40 UTC, Volga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volga 2017-11-27 09:39:24 UTC
Description:
If text inserted Unicode BiDi characters, they could be rendering with fallback fonts.

Steps to Reproduce:
1. Copying some texts from https://en.wikipedia.org/wiki/Bi-directional_text#Chinese_characters_and_other_CJK_scripts
2. Paste into Writer
3. Set CJK font face

Actual Results:  
When CJK texts surrounding by BiDi characters, they aren’t rendered with specified font, using fallback fonts instead.

Expected Results:
Text surrounding with Bidi characters should be rendering with specified font even if the font does not has corresponding grapheme.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.0.0.0.beta1 (x64)
Build ID:97471ab4eb4db4c487195658631696bb3238656c
CPU 线程:4; 操作系统:Windows 10.0; UI 渲染:默认; 
Locale: zh-CN (zh_CN); Calc: group threaded


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Comment 1 Volga 2017-11-27 09:40:04 UTC
Created attachment 138012 [details]
Test file
Comment 2 Volga 2017-11-27 09:40:28 UTC
Created attachment 138013 [details]
Snapshot
Comment 3 Kevin Suo 2017-11-27 09:59:37 UTC
Do you mean setting same CJK font face to the two "海南航空"?
I tried to set both of them to "思源宋体 CN Medium", they are displaying correctly as this font. 
I also tried "仿宋", it works.

Am I doing right? If I am doing right, this may be tested by someone else on Windows.
Comment 4 Volga 2017-11-29 16:48:18 UTC
(In reply to Kevin Suo from comment #3)
> Do you mean setting same CJK font face to the two "海南航空"?
> I tried to set both of them to "思源宋体 CN Medium", they are displaying
> correctly as this font. 
> I also tried "仿宋", it works.
> 
> Am I doing right? If I am doing right, this may be tested by someone else on
> Windows.

I tested again, if I selest the who text, then set the font to "仿宋", it works, but if I set different font face for Western Text Font and Asian Text Font, the problem appearing to me.
Comment 5 Hiunn-hué 2017-11-30 11:01:42 UTC
Hi,

If I understand it correctly, that's because the RTL text "空航南海" here is identified as CTL Text, rather than East Asian Text. (Move the cursor to the text, and check the status bar.)

Therefore, it's using the font set for CTL Text (Format -> Character -> CTL font).


---

Tested on:

Version: 6.1.0.0.alpha0+
Build ID: 42dafb5c7bd218f4d368fbd1113fa4a0fcd7f0cb
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-11-30_00:36:09
Locale: zh-TW (zh_TW.UTF-8); Calc: group threaded

---
Comment 6 Volga 2017-11-30 14:52:27 UTC
(In reply to Hiunn-hué from comment #5)
> Hi,
> 
> If I understand it correctly, that's because the RTL text "空航南海" here is
> identified as CTL Text, rather than East Asian Text. (Move the cursor to the
> text, and check the status bar.)
> 
> Therefore, it's using the font set for CTL Text (Format -> Character -> CTL
> font).
Yes, the usage of BiDi characters should be used for controlling text direction, and just set costomized direction within text, not affect font rendering for surrounding text.
Comment 7 ⁨خالد حسني⁩ 2017-12-01 22:32:00 UTC
I don’t this is a font fallback issue since our HarfBuzz-based font fallback code certainly handles this (i.e. does not require control characters to be present in the font). I suspect the issue is happening at a higher level when we decide if a character should use Western/CTL/CJK font.
Comment 8 Volga 2017-12-02 05:55:14 UTC Comment hidden (obsolete)
Comment 9 ⁨خالد حسني⁩ 2017-12-03 15:22:20 UTC
(In reply to Volga from comment #8)
> So is it possible to add exceptions to make BiDi characters independent of
> Western/CTL/CJK font settings?

Possibly, I’m not 100% sure this is what is going on.
Comment 10 QA Administrators 2018-12-04 03:47:51 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2020-12-04 04:16:38 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2022-12-05 03:32:49 UTC
Dear Volga,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug