Font caching issues! (1 Viewer)

ripk

Portal Member
April 13, 2009
29
6
Hello all,

I think I've found a potential problem in the way the fonts are cached in Mediaportal - the caching is performed for characters in the active locale only! For example, I have set up my installation in English language, but I'm using UTF-encoded information in EPG to display content that contais Croatian characters. As a consequence, any string that contains accented characters will not be rendered in the correct font. I'm using StreamedMP but as far as I understand, caching is done on the systems-level and all skins may be sensitie to this problem.

I spent a lot of time to diagnose this problem - the fonts used in StreamedMP all have accented characters and they refused to display! Until finally I had a look at the content of the cached font bitmaps and discovered that my chars are not there :)
If I switch the language of Mediaportal to Croatian, then everything gets displayed in the correct font, but I have translations in my menus, whic I do not want.

The solution would be to cache ALL characters in a font, regardless of the encoding of the Mediaportal language.

I've attached a screenshot to demonstrate the problem.


K
 

Attachments

  • Correct_font.jpg
    Correct_font.jpg
    313.5 KB
  • Incorrect_font.jpg
    Incorrect_font.jpg
    315.4 KB

ripk

Portal Member
April 13, 2009
29
6
Some fonts can contain thousands of charachters. Those could fill up the GPU memory in some cases so caching all is not possible.

There is some work done in that area: https://github.com/MediaPortal/Medi...e_GUIFontManager_for_out_of_bounds_characters

Great! As far as I understood from the code, out of bounds (uncached) chars will not be rendered in Arial but in the correct font without caching - this solution is ideal, I'd gladly sacrifice some performance for the visual perfection :)
 

SilentException

Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    As a partial workaround in this moment, you can do this:

    Open MediaPortal.xml (configuration file) in notepad while both MediaPortal and Configuration is CLOSED. Find "debug" section and add one line in it:

    Code:
    <section name="debug">
        <entry name="useExtendedCharsWithStandardCulture">512</entry>
    </section>

    That way, you can still have English language and 512 characters cached, which will be enough for all local ones.
     

    ripk

    Portal Member
    April 13, 2009
    29
    6
    As a partial workaround in this moment, you can do this:

    Open MediaPortal.xml (configuration file) in notepad while both MediaPortal and Configuration is CLOSED. Find "debug" section and add one line in it:

    Code:
    <section name="debug">
        <entry name="useExtendedCharsWithStandardCulture">512</entry>
    </section>

    That way, you can still have English language and 512 characters cached, which will be enough for all local ones.

    Yay! Works like a charm! Thanks SilentException! :D
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Holzi: I don't think so. It looks more like a data retrieval problem.

    ripk: NP. And to answer your PM about that branch, I created it to help with even higher index unicode characters (for example, above 2000). It would be impossible to cache all of them.
     

    Holzi

    Super Moderator
  • Team MediaPortal
  • April 21, 2010
    7,934
    2,235
    Ba-Wü
    Home Country
    Germany Germany
    AW: Font caching issues!

    Thanks!
    I thought so and it's only for (one) specific channels which fail in displaying the letter "ß" so maybe its a provider problem?!
     

    Users who are viewing this thread

    Top Bottom