Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Indian fonts in Kodi not displayed properly
#1
Question 
Hi, I am using 16.1 on my machines that run Ubuntu and Librelec. On both machines, I have set my scraper settings to Keep Original Title. For some movies, TMDB has the original movie title using the Devanagari script (as per required by their new rules). See this entry for example. Now on my Ubuntu machine, the original title shows up as a bunch of rectangular crossed out blocks. On Libreelec, the title is blank. This is clearly a fonts availability issue. Does Kodi not include such fonts by default? If not, can someone point me to resources which allow me to install custom fonts.
Thanks.
Reply
#2
Have you tried changing the Font in Settings -> Appearance -> Skin to Arial
Reply
#3
Unfortunately it appears that the arial.ttf (DejaVu Sans (book)) font does not have coverage for the Devanagari unicode block. However, I found a freeware font from University of Penn "JaipurUnicode" (unfortunately, no license included with file) that I could merge into Kodi's arial font. If you want to give it a try, download the mod ttf font from here:
https://www.dropbox.com/s/0qoyw7q39xx38h...r.ttf?dl=0

Go into your Kodi program directory and navigate to /media/Fonts directory.
Rename the file arial.ttf to arial_orig.ttf
Download the file DejaVuSans_Jaipur.ttf into this directory
Rename this new file to arial.ttf
Start Kodi
In interface settings set font to "arial based" (assumes you use Estuary (Krypton) or Confluence (Jarvis) skin)

I did a quick test using some random text sample I found online:

Image

Image

scott s.
.
Reply
#4
If you don't mind trying another skin, you can install Mimic in Kodi 17 and change the font to Jaldi.
Reply
#5
@jjd-uk That did not work
@scott-967 This does work on 16.1 on Ubuntu but as you pointed out, is limited to Confluence. Thumbs up for digging out that font file!
@braz I plan to try Krypton out in the coming days so will keep you posted.
Thanks for all your help.

Also, I just learned that Tamil fonts fall in a different category. See the original movie title for this example. Using the font provided by scott967 does not work in this case.
Reply
#6
Mimic 5 also supports Tamil with the Catamaran font. Not sure if a single font supports both type families though, you'd have to try it.
Reply
#7
@braz I just tested Mimic with Krypton and I confirm your findings.Yet to find a font family that supports both...
Reply
#8
(2017-01-05, 22:42)braz Wrote: If you don't mind trying another skin, you can install Mimic in Kodi 17 and change the font to Jaldi.

I tried using Mimic with a custom malayalam font, but the font rendering is incorrect. This may be due to something beyond the theme itself. Theme recognizes the font and i am able to select the font. But the rendering is wrong! Pls see this image: https://photos.app.goo.gl/JE2kHLGBgBv2n9ew8

Image
Reply
#9
I don't think there are many experts in Indic languages here.  Could you provide the sample text strings maybe from strings.po in resource.language.ml_in and maybe some screenshots of proper rendering?  Also what font you used for testing?

I'm guessing the problem is in the freetype 2 methods Kodi uses to render text from ttf fonts.

scott s.
.
Reply
#10
Thanks for taking the time /effort to to do a clean install, but you need to turn on debug level logging in your settings (log you posted shows)
Code:
Disabled debug logging due to GUI setting. Level 0.
.
I'm assuming the problem is color mapping of HDR content to SDR.   Note I'm not that informed of video but there are better people at it here and seeing the debug log can help avoiding making assumptions about your setup.

scott s.
.
Reply
#11
(2019-04-15, 21:57)scott967 Wrote: I don't think there are many experts in Indic languages here.  Could you provide the sample text strings maybe from strings.po in resource.language.ml_in and maybe some screenshots of proper rendering?  Also what font you used for testing?

I'm guessing the problem is in the freetype 2 methods Kodi uses to render text from ttf fonts.

ImageImage

Thanks Scott. I am attaching the screenshots with wrong rendering by kodi in white colour text and correct rendering in the red colour text. Hope this is clear... 
I tried using font chilanka and google noto malayalam. 
Chilanka font is available here: http://smc.org.in/downloads/fonts/chilanka/Chilanka.ttf
Noto Malayala​​​​​​m is available here: https://noto-website-2.storage.googleapi...hinted.zip
Reply
#12
First, I am not export of Kodi's code so this is sort of a guess

From what I see, Kodi uses Freetype 2 to render the glyphs found in trutype fonts into screen bitmaps.  Freetype basically does glyph lookup using the font's unicode cmap table and sizes / hints the resulting glyph with I guess some combining/positioning capabilities for compound characters (characters composed of two or more glyphs).

However, it appears that some more complex shaping required in certain script6s such as Arabic and Indic must follow certain rules established in the opentype spec.  The freetype devs consider implementing these shaping rules outside the scope of freetype.  There exist implementations such as Harfbuzz in Linux.

So, I don't see any easy fix for this problem.  It will require a dev with knowledge of typographic rendering to understand / update Kodi's font rendering code.

scott s.
.
Reply
#13
Hi,

What does Kodi use for rendering and text shaping? Can it use Pango/Harfbuzz since those provide great support for almost all scripts and languages ?
Reply
#14
(2019-06-29, 12:25)balasankarc Wrote: Hi,

What does Kodi use for rendering and text shaping? Can it use Pango/Harfbuzz since those provide great support for almost all scripts and languages ?
I don't see that much development work has gone on in the font management/rendering code in recent years.  It would need someone with experience in text displaying to review and see what improvements could be made.

scott s.
.
Reply

Logout Mark Read Team Forum Stats Members Help
Indian fonts in Kodi not displayed properly0