Bug 968892 - [Indic] rendering for CTL is not correct with selected fallback font
[Indic] rendering for CTL is not correct with selected fallback font
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: libreoffice (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Caolan McNamara
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-30 04:35 EDT by Parag Nemade
Modified: 2013-06-07 23:38 EDT (History)
8 users (show)

See Also:
Fixed In Version: libreoffice-4.1.0.0-6.beta1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-07 23:38:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Referece image for incorrect rendering (60.84 KB, image/png)
2013-05-30 06:22 EDT, Parag Nemade
no flags Details
Reference image for correct rendering (59.88 KB, image/png)
2013-05-30 06:23 EDT, Parag Nemade
no flags Details

  None (edit)
Description Parag Nemade 2013-05-30 04:35:03 EDT
Description of problem:
When a basic consonant is typed with dependent vowels then formed glyph with either upper base or below base renders incorrectly. It just shows basic character. This happens with default Liberation Sans font. But, When I set the appropriate font for that Indic language it renders correctly. I think libreoffice( say writer) should detect the font automatically once I start typing in any language and set it to that language font.


Version-Release number of selected component (if applicable):
libreoffice-4.1.0.0-2.beta1.fc19.x86_64

How reproducible:
always

Steps to Reproduce:
1. Select Telugu Inscript input method
2. Type <shift+5> or <shift+6>
3. Observe rendering is incorrect.

Actual results:
rendering is incorrect and font does not get set automatically. E.g. If typing in Telugu language, once you start typing font should remains "Liberation Sans".

Expected results:
Rendering should be correct and font should get automatically selected. E.g. If typing in Telugu language, once you start typing font should get changed to "Lohit Telugu".





Additional info:
Comment 1 Parag Nemade 2013-05-30 04:45:20 EDT
Please read "Liberation Serif" above not "Liberation Sans".

Further investigation on Indic rendering found that when using English Desktop, any Indic language for input except Hindi, font changes from "Liberation Serif" to "Lohit Devanagari" only. Thus, incorrect rendering and base glyphs only.

For Hindi Indic language its set correctly to "Lohit Devanagari" only. Thus, correct rendering.
Comment 2 Caolan McNamara 2013-05-30 04:55:33 EDT
Writer has three categories of fonts, western, ctl and cjk. so 
a) 'If typing in Telugu language, once you start typing font should remains "Liberation Sans".' isn't what should happen, what should happen is that the font listed as the complex text language should be used, whatever that font happens to be. (enable the ctl options if started in a western locale and use format character to see what that font is)
b) 'If typing in Telugu language, once you start typing font should get changed to "Lohit Telugu".' Nah, it should be whatever the font for that category is set to as per a)

but all that's beside the point, it should still render correctly anyway via fallbacks.
Comment 3 Parag Nemade 2013-05-30 06:22:39 EDT
Created attachment 754768 [details]
Referece image for incorrect rendering
Comment 4 Parag Nemade 2013-05-30 06:23:16 EDT
Created attachment 754769 [details]
Reference image for correct rendering
Comment 5 Pravin Satpute 2013-05-30 06:29:49 EDT
Thanks parag for images. I also tried for same.

So basic problem is if i type something for Telugu text and apply Lohit Telugu font it works perfectly.

But if i change font for Telugu text something else (other than Lohit Telugu), it does not render it perfectly with Fallback font. Same applies for all other scripts.

Sample text given in above images: జ్ఞత్ర  "u'\u0c1c\u0c4d\u0c1e\u0c24\u0c4d\u0c30"
Comment 7 Caolan McNamara 2013-06-04 09:18:23 EDT
what this might be is that the current font can't render *all* the text, but can render some of it, leading to the grapheme getting split up over different fonts, rather than trying to get the entire block rendered with a fallback font that can do the lot.
Comment 8 Caolan McNamara 2013-06-04 11:27:21 EDT
implemented that, and will backport to f19. That helps a lot *if* the language of the text is set correctly (format->character). If the language is wrong then the wrong language is passed down to the layout engine.

Not entirely sure what to do about that problem. Some kind of "the language set on this text cannot be correct, so force detection to override" thing would work I suppose
Comment 9 Caolan McNamara 2013-06-04 12:19:23 EDT
lets try that then. When doing glyph fallback if the language set on the text could not possibly be a correct language then discard it and auto-detect it for the purposes of getting a good fallback font.

Only for text in the Telugu script and Bengali/Assamese for now.
Comment 10 Parag Nemade 2013-06-05 01:26:29 EDT
My observations on libreoffice-4.1.0.0-5.beta1.fc19 build =>

1) For Telugu script, I can verify that rendering is working for conjunct characters. But the confusing part is font name still shows "Lohit Devanagari", Can it be shown correctly to higher priority font? For Fedora it should show "Lohit Telugu" 

I think same will apply for Bengali/Assamese script.

2) If I use same script and locale everything works fine. e.g. Libreoffice in Assamese desktop sets correctly fonts and renders Assamese fine.

So, If I start libreoffice in any Indic locale and try to write in different Indic scripts, rendering will not be correct for whole typed text.
Comment 11 Fedora Update System 2013-06-05 04:14:28 EDT
libreoffice-4.1.0.0-5.beta1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/libreoffice-4.1.0.0-5.beta1.fc19
Comment 12 Caolan McNamara 2013-06-05 05:40:07 EDT
'1) The confusing part is font name still shows "Lohit Devanagari", Can it be shown correctly to higher priority font? For Fedora it should show "Lohit Telugu"'

That's just not how it works. It should not show "Lohit Telugu", it should show what font the user selected as the font to use for the CTL category (or the computer-selected defaults). I mean, launch writer, turn on CTL and look at "format character". There's a single "CTL" category. What we do is select the default language for that category based on your locale, with a fallback to Hindi if there's no useful hint otherwise. Then the default font is selected based on that language.

If that font then can't render it we should still be able to glyph fallback and get it rendered correctly.

'2) If I use same script and locale everything works fine. e.g. Libreoffice in Assamese desktop sets correctly fonts and renders Assamese fine.'

Yes, if you start in Assamese, then the default CTL language will be set to Assamese, which then selects the default font for Assamese to be "Lohit Assamese"

"If I start libreoffice in any Indic locale and try to write in different Indic scripts, rendering will not be correct for whole typed text."

From the word processors perspective you're writing text in the language set as the CTL language in format character. What I'm now trying to add is to detect at the bottom level rendering level if text has a completely impossible language set and reject that language choice for the purposes of the last-ditch glyph fallback.

Is there remaining broken rendering examples ?
Comment 13 Parag Nemade 2013-06-05 05:56:56 EDT
yes. I found only Kannada and Oriya is not rendering correctly. Other Indic locales to whatever minimal testing I did are working fine.
Comment 14 Parag Nemade 2013-06-05 06:24:00 EDT
I retested and found Kannada is working fine. Not sure what went wrong before. I typed in some Indic locales on same line and Kannada failed. I think might be due to Oriya and then in Kannada on same line. But now again in English locale, using Kannada Inscript keymap and <Shift+6> gave correct character.

But, Oriya is still failing to render for me. See for Oriya Inscript keymap <Shift+6> is not rendering correctly.
Comment 15 Fedora Update System 2013-06-05 12:52:30 EDT
Package libreoffice-4.1.0.0-5.beta1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libreoffice-4.1.0.0-5.beta1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-10088/libreoffice-4.1.0.0-5.beta1.fc19
then log in and leave karma (feedback).
Comment 16 Fedora Update System 2013-06-05 15:26:11 EDT
libreoffice-4.1.0.0-6.beta1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/libreoffice-4.1.0.0-6.beta1.fc19
Comment 17 Pravin Satpute 2013-06-06 04:52:01 EDT
One query:
Why are we changing font from Liberation Serif to Lohit Devanagari when someone type language specific content?

I think if fallback is working fine, simply keep the same fonts "Liberation Serif" and let user select his desired font.
Comment 18 Caolan McNamara 2013-06-06 06:56:06 EDT
"Why are we changing font from Liberation Serif to Lohit Devanagari when someone type language specific content?"

We're not changing the font. There are three categories of text in LibreOffice (and Microsoft Office too) "Western" "CJK" and "CTL". Each category can have a different font. If (with the UI enabled under tools options languages to see them) you do "format character" without entering any text you can see the three fonts. So when the cursor is over text of a given category it shows the font of that category. I mean the CTL font was "Lohit Devangari" (or whatever) already. Its just showing you that now because the cursor is now over some CTL text.
Comment 19 Pravin Satpute 2013-06-07 04:38:03 EDT
That is actually good. Since each script might have different requirement, so good to change font. Thanks Caolan for updating on this.
Comment 20 Fedora Update System 2013-06-07 23:38:45 EDT
libreoffice-4.1.0.0-6.beta1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.