Bug 165887 - Devanagari font rendering issues
Summary: Devanagari font rendering issues
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CTL
  Show dependency treegraph
 
Reported: 2025-03-24 05:57 UTC by madhavkiran.sodum
Modified: 2025-11-22 05:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
LO view (139.58 KB, image/png)
2025-03-24 05:57 UTC, madhavkiran.sodum
Details
MSO view (56.12 KB, image/png)
2025-03-24 05:57 UTC, madhavkiran.sodum
Details
The sample file used (8.74 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-03-24 05:58 UTC, madhavkiran.sodum
Details
Comparison: Word vs. Writer with Kokila font (17.72 KB, image/png)
2025-11-21 17:41 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description madhavkiran.sodum 2025-03-24 05:57:22 UTC
Created attachment 199987 [details]
LO view

This is a follow-up to Bug 164106. 

LO doesn't recognize the Devanagari font and even when the font is manually changed, it shows the wrong attributes for the text. MSO displays it properly and rightly doesn't combine the characters which have different attributes.
Comment 1 madhavkiran.sodum 2025-03-24 05:57:48 UTC
Created attachment 199988 [details]
MSO view
Comment 2 madhavkiran.sodum 2025-03-24 05:58:13 UTC
Created attachment 199989 [details]
The sample file used
Comment 3 madhavkiran.sodum 2025-03-24 06:00:55 UTC
the font used is Kokila and may be downloaded from here: https://freefontsfamily.org/kokila-font-free/
Comment 4 Buovjaga 2025-11-21 17:41:24 UTC
Created attachment 204182 [details]
Comparison: Word vs. Writer with Kokila font

The text in attachment 199989 [details] does not use Kokila, but I formatted it both in office.com's Word and Writer and created a side-by-side comparison.

Arch Linux 64-bit
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c2a0e06b637f798b508de408f820f496a5419d9f
CPU threads: 8; OS: Linux 6.17; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 20 November 2025
Comment 5 Eyal Rozenberg 2025-11-21 19:02:02 UTC
Can someone elaborate a little about what the issue here is? Is it the handling and use of some fonts vs. other fonts? Is it the fact that, in the image buovjaga posted, some sequences of characters appear to have stronger weight on the MSO side? Is it the use of what seem to be different characters a little past the middle of the first line (after the टे character and before the र्य)? If it is multiple problems, please spell them out. I realize this might be more obvious for people who know Devangari, but some of the problems may relate to other CTL/RTL issues, so it might be useful to go to that trouble.
Comment 6 madhavkiran.sodum 2025-11-22 05:16:12 UTC
(In reply to Eyal Rozenberg from comment #5)
> Can someone elaborate a little about what the issue here is? Is it the
> handling and use of some fonts vs. other fonts? Is it the fact that, in the
> image buovjaga posted, some sequences of characters appear to have stronger
> weight on the MSO side? Is it the use of what seem to be different
> characters a little past the middle of the first line (after the टे
> character and before the र्य)? If it is multiple problems, please spell them
> out. I realize this might be more obvious for people who know Devangari, but
> some of the problems may relate to other CTL/RTL issues, so it might be
> useful to go to that trouble.


The problem is basically to do with how ligatures are handled when their component letters have different attributes/formats:

The sample file has the following text:
कन्दर्पकोटेर्यदर्बुदं 
वीथीर्भजनमार्गान् 
सद्मान्तर्गृहमध्ये 
ताभिर्ललितादिसखिभिः  

But the text within the square brackets is actually bold: 
कन्दर्प[कोटेर्]यद[र्बुदं]
[वीथीर्]भजनमार्गान्
[सद्मान्तर्]गृहमध्ये
[ताभिर्]ललितादिसखिभिः

MSO displays the bracketed text as bold - but of course splits the ligature whose initial component is of one attribute and the second component is of another attribute. 

But LO does not do that. Instead it turns the bold text into regular and then displays keeping the ligature combined.

This issue is not just with bold. The same issue is there even when the bracketed text is italics, bold-italics, a different color, etc.

This affects when you compare two devanagari files - the differences (which are marked by different colors) do not show up properly.