Red Hat Bugzilla – Bug 968892
[Indic] rendering for CTL is not correct with selected fallback font
Last modified: 2013-06-07 23:38:45 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):
Steps to Reproduce:
1. Select Telugu Inscript input method
2. Type <shift+5> or <shift+6>
3. Observe rendering is incorrect.
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".
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".
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.
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.
Created attachment 754768 [details]
Referece image for incorrect rendering
Created attachment 754769 [details]
Reference image for correct rendering
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"
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.
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
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.
My observations on libreoffice-220.127.116.11-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.
libreoffice-18.104.22.168-5.beta1.fc19 has been submitted as an update for Fedora 19.
'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 ?
yes. I found only Kannada and Oriya is not rendering correctly. Other Indic locales to whatever minimal testing I did are working fine.
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.
* 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-22.214.171.124-5.beta1.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
libreoffice-126.96.36.199-6.beta1.fc19 has been submitted as an update for Fedora 19.
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.
"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.
That is actually good. Since each script might have different requirement, so good to change font. Thanks Caolan for updating on this.
libreoffice-188.8.131.52-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.