Special characters shown with system font (1 Viewer)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    MediaPortal Version: 1.2.0.1
    MediaPortal Skin: DefaultWide
    Windows Version: Windows 7 x64
    CPU Type: AMD Athlon II x2 240e 2.8 GHz 45w TDP
    HDD: OCZ Agility SSD 30 GB
    Memory: 4 GB DDR2 800 MHz Dual-Channel
    Motherboard: Gigabyte GA-MA78GM-S2H (rev 1.0)
    Video Card: Onboard AMD Radeon HD 3200
    Video Card Driver: Catalyst 11.x
    Sound Card: Onboard ALC889A
    Sound Card AC3: optical out
    Sound Card Driver:
    1. TV Card: Terratec Cinergy 2400i DT PCI
    1. TV Card Type: DVB-T
    1. TV Card Driver:
    2. TV Card:
    2. TV Card Type:
    2. TV Card Driver:
    3. TV Card:
    3. TV Card Type:
    3. TV Card Driver:
    4. TV Card:
    4. TV Card Type:
    4. TV Card Driver:
    MPEG2 Video Codec: Microsoft DTV-DVD Video Codec
    MPEG2 Audio Codec: Microsoft DTV-DVD Audio Codec
    h.264 Video Codec: Microsoft DTV-DVD Video Codec
    Satelite/CableTV Provider:
    HTPC Case:
    Cooling:
    Power Supply: picuPSU 120W
    Remote: Logitech 885
    TV: LG 50PK350N
    TV - HTPC Connection: HDMI

    Hi

    While doing a new skin, I ran into the usual problem with fonts not being able to show special characters, one of them was "right single quotation mark":
    Unicode Character 'RIGHT SINGLE QUOTATION MARK' (U+2019)

    This character was in some of the songs on the album Adele - 21.

    The problem is visible in my skin, because the font I use is very different from the system font:
    (Look at the top three songs, compared to the rest).
    adele1.jpg

    OK, so I investigate further. "Right single quotation mark" is mapped correctly in the font, and I can use it in Photoshop, Word etc.
    Unicode symbol is U+2019 which is well in range of normal UTF-8 fonts.

    fonts.xml is correct;

    Code:
    	<font>
    		<name>edit_medium</name>
    		<filename>Reflex Main Caps</filename>
    		<height>14</height>
        <start>0</start>
        <end>1536</end>
    	</font>

    So how does it look in default skin, with default fonts?
    Close, but you can tell there is a difference, look at this screenshot with the overlay on a working text versus a non-working text:
    (I have encircled the problem in red)
    adele3.jpg

    I believe MediaPortal has a problem interpreting special characters, unless proven otherwise.

    Let me know what you think!
     

    Attachments

    • adele2.jpg
      adele2.jpg
      261.5 KB

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Yes, I have also seen this when using Rockstar plugin.
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    MediaPortal caches X characters from fonts.xml fonts. X is read from your current language file. I believe it's 256 for English and many others. Having this number increased makes graphic cache ofcourse larger. I would suggest you try increasing the X :)

    You can also force this number without modifying language XML. Search or add this section in MediaPortal.xml

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

    Clear cache before starting.
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #4
    MediaPortal caches X characters from fonts.xml fonts. X is read from your current language file. I believe it's 256 for English and many others. Having this number increased makes graphic cache ofcourse larger. I would suggest you try increasing the X :)

    You can also force this number without modifying language XML. Search or add this section in MediaPortal.xml

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

    Clear cache before starting.

    I have seen this option somewhere in the forum before, but it didn't change anything for me back then, and it didn't change anything this time either :(

    I have cleared the cache, and I set it to 1536 even though a "yes" would be just as good (found the old Mantis-entry while searching).

    EDIT: Setting "characters" in strings_da.xml to a higher value, as suggested in https://forum.team-mediaportal.com/...-text-style-when-local-characters-used-89256/ didn't do anything either.
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Yes/No were the old settings. No was default (from language file) and Yes was 1536 (fixed). Then, in 1.2.0 Alpha, I enabled numbers as well. Not sure, maybe 1536 is not enough for your char.. Increase? ;)

    Also, It's to be noted that this only happens on Vista/Win7. On XP a [box] would be rendered for unknown char. As far as I can remember from looking at the code before, font rendering in Vista/Win7 uses different methods. It might maybe be possible to handle unknown chars differently in there.
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #6
    Is there a way to figure out what is correct? And why would strings_da.xml be set to 255 by default? Both swedish, norvegian and finnish is set to 255 as well. And Unicode Character 'RIGHT SINGLE QUOTATION MARK' (U+2019) is not a special character for our countries, it's used all over the world.

    If you look at the last post in https://forum.team-mediaportal.com/...-text-style-when-local-characters-used-89256/ (which is mine) I raised this problem back then :)

    Same problem, "right single quotation mark".
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    List of Unicode characters - Wikipedia, the free encyclopedia

    Characters are set in classes. This right single quotation mark is way down below in the list. You would have to use much larger number to have it cached. Cache would probably fail to be generated as well, since it would be too large to put in graphics memory. Sorry, there is no way around this, unless font rendering is modified. And even then, depending on the way it's modified, you might not have correct character (but a [box] or space or something).

    What your languages have set in XML is only translator "fault". If your language uses characters above U+00FF (255), they should have larger number in the XML.
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #8
    All of these characters are in the "General punctuation" group:

    U+2010 ‐ Hyphen
    U+2011 ‑ Non-Breaking Hyphen
    U+2012 ‒ Figure Dash
    U+2013 – En Dash
    U+2014 — Em Dash
    U+2015 ― Horizontal Bar
    U+2016 ‖ Double Vertical Line
    U+2017 ‗ Double Low Line
    U+2018 ‘ Left Single Quotation Mark
    U+2019 ’ Right Single Quotation Mark
    U+201A ‚ Single Low-9 Quotation Mark
    U+201B ‛ Single High-Reversed-9 Quotation Mark
    U+201C “ Left Double Quotation Mark
    U+201D ” Right Double Quotation Mark
    U+201E „ Double Low-9 Quotation Mark
    U+201F ‟ Double High-Reversed-9 Quotation Mark

    I do not hope that MediaPortal renders text with the system-font if they are used. Then it should be "fixed" (fixed as in do it some other way)
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #9
    Latest XBMC (codename Eden I think) shows the quotation sign correctly. Whatever they do, we should be able to as well :)
     

    Attachments

    • xbmc_ok.jpg
      xbmc_ok.jpg
      270.9 KB

    Users who are viewing this thread

    Top Bottom