Special characters shown with system font | Page 3

Discussion in '1.2.x' started by pilehave, November 27, 2011.

  1. pilehave
    • Premium Supporter

    pilehave Community Skin Designer

    Joined:
    April 2, 2008
    Messages:
    2,566
    Likes Received:
    500
    Gender:
    Male
    Occupation:
    Technical consultant, marketing
    Location:
    Hornslet
    Ratings:
    +517 / 0
    Home Country:
    Denmark Denmark
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. pilehave
    • Premium Supporter

    pilehave Community Skin Designer

    Joined:
    April 2, 2008
    Messages:
    2,566
    Likes Received:
    500
    Gender:
    Male
    Occupation:
    Technical consultant, marketing
    Location:
    Hornslet
    Ratings:
    +517 / 0
    Home Country:
    Denmark Denmark
    Help :)

    How do I (using TortoiseGIT) switch to your new branch (or whatever it is called?). I already pulled the 2.15 GB(!) MediaPortal-1 folder with GIT.
     
  4. SilentException
    • Team MediaPortal

    SilentException Retired Team Member

    Joined:
    October 27, 2008
    Messages:
    2,617
    Likes Received:
    1,125
    Gender:
    Male
    Location:
    Rijeka, Croatia
    Ratings:
    +1,129 / 0
    Home Country:
    Croatia Croatia
    If you cloned the repo then do a Sync->Pull. Then choose Switch, and select "remotes/origin/EXP-Improve..." branch.. It will switch instantly.
     
  5. pilehave
    • Premium Supporter

    pilehave Community Skin Designer

    Joined:
    April 2, 2008
    Messages:
    2,566
    Likes Received:
    500
    Gender:
    Male
    Occupation:
    Technical consultant, marketing
    Location:
    Hornslet
    Ratings:
    +517 / 0
    Home Country:
    Denmark Denmark
    Do I have to change any settings in MediaPortal.xml or in strings_da.xml for this to work? I rebuild MP, and I checked that the code used was with the changes you made, but I do not see an improvement.

    If You would like some WMA-files with a problematic character in songnames, I can supply you with that. (ID3-tags with single right quotation mark).

    The changes below works on my system, but I guess they are still hacks and not proper coding. But it works for all labels or controls that extends from labels. textbox and textboxscrollup were special, so added code for them as well:

    Code (Text):
    1.  
    2. Index: GUILabelControl.cs
    3. ===================================================================
    4. --- GUILabelControl.cs  (revision 28260)
    5. +++ GUILabelControl.cs  (working copy)
    6. @@ -74,6 +74,8 @@
    7.        : base(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight)
    8.      {
    9.        _labelText = strLabel;
    10. +      _labelText = _labelText.Replace("‘", "'");
    11. +      _labelText = _labelText.Replace("’", "'");
    12.        _fontName = strFont;
    13.        _textColor = dwTextColor;
    14.        _textAlignment = dwTextAlign;
    15. @@ -117,6 +119,10 @@
    16.        {
    17.          _containsProperty = true;
    18.        }
    19. +
    20. +      _labelText = _labelText.Replace("‘", "'");
    21. +      _labelText = _labelText.Replace("’", "'");
    22. +
    23.        CachedLabel();
    24.      }
    25.  
    26. @@ -463,6 +469,8 @@
    27.          {
    28.            _containsProperty = false;
    29.          }
    30. +        _labelText = _labelText.Replace("‘", "'");
    31. +        _labelText = _labelText.Replace("’", "'");
    32.  
    33.          CachedLabel();
    34.        }
    35. @@ -489,6 +497,8 @@
    36.          _textheight = 0;
    37.          _reCalculate = true;
    38.          _cachedTextLabel = v;
    39. +        _cachedTextLabel = _cachedTextLabel.Replace("‘", "'");
    40. +        _cachedTextLabel = _cachedTextLabel.Replace("’", "'");
    41.          _context = null;
    42.        }
    43.      }
    44. Index: GUITextControl.cs
    45. ===================================================================
    46. --- GUITextControl.cs   (revision 28260)
    47. +++ GUITextControl.cs   (working copy)
    48. @@ -719,6 +719,10 @@
    49.        {
    50.          return;
    51.        }
    52. +
    53. +      strText = strText.Replace("‘", "'");
    54. +      strText = strText.Replace("’", "'");
    55. +
    56.        _itemList.DisposeAndClearList();
    57.        // start wordwrapping
    58.        // Set a flag so we can determine initial justification effects
    59. Index: GUITextScrollUpControl.cs
    60. ===================================================================
    61. --- GUITextScrollUpControl.cs   (revision 28260)
    62. +++ GUITextScrollUpControl.cs   (working copy)
    63. @@ -548,6 +548,8 @@
    64.          int iLastSpaceInLine = -1;
    65.          string szLine = "";
    66.          strText = strText.Replace("\r", " ");
    67. +        strText = strText.Replace("‘", "'");
    68. +        strText = strText.Replace("’", "'");
    69.          strText.Trim();
    70.          while (pos < strText.Length)
    71.          {
    72.  
     
  6. SilentException
    • Team MediaPortal

    SilentException Retired Team Member

    Joined:
    October 27, 2008
    Messages:
    2,617
    Likes Received:
    1,125
    Gender:
    Male
    Location:
    Rijeka, Croatia
    Ratings:
    +1,129 / 0
    Home Country:
    Croatia Croatia
    Quite sure you didn't build correctly:
     

    Attached Files:

    • 14-00-50.png
      14-00-50.png
      File size:
      668 KB
      Uploaded:
      November 28, 2011
      Views:
      130
    • 14-18-45.png
      14-18-45.png
      File size:
      670.6 KB
      Uploaded:
      November 28, 2011
      Views:
      128
  7. pilehave
    • Premium Supporter

    pilehave Community Skin Designer

    Joined:
    April 2, 2008
    Messages:
    2,566
    Likes Received:
    500
    Gender:
    Male
    Occupation:
    Technical consultant, marketing
    Location:
    Hornslet
    Ratings:
    +517 / 0
    Home Country:
    Denmark Denmark
    Opened the MP solution, chose Release and chose Rebuild Solution.

    Then navigated to MediaPortal-1\mediaportal\MediaPortal.Application\bin\Release and ran MP from there.

    SE: I sent you a PM with testfiles.
     
  8. pilehave
    • Premium Supporter

    pilehave Community Skin Designer

    Joined:
    April 2, 2008
    Messages:
    2,566
    Likes Received:
    500
    Gender:
    Male
    Occupation:
    Technical consultant, marketing
    Location:
    Hornslet
    Ratings:
    +517 / 0
    Home Country:
    Denmark Denmark
    OK, it seems to work in Windows 7, but there is some kind of calculation issue with the size and spacing between letters.

    The attached picture show a difference, it is not much, but the same text is moving up/down 1 pixel and the spacing between the dot after the track number and the track name, varies from 14px to 22px.

    The spacing around the "-" is also larger on the text on the right side.

    When you scroll the listcontrol, the difference is quite visible, at least with the font I use.

    Try and zoom in on the picture I have attached.

    This difference is probably because there is a difference between GUIFontManager.DrawText and FontEngineDrawText3D

    right?
     

    Attached Files:

    • difference.jpg
      difference.jpg
      File size:
      116.8 KB
      Uploaded:
      November 28, 2011
      Views:
      143
  9. SilentException
    • Team MediaPortal

    SilentException Retired Team Member

    Joined:
    October 27, 2008
    Messages:
    2,617
    Likes Received:
    1,125
    Gender:
    Male
    Location:
    Rijeka, Croatia
    Ratings:
    +1,129 / 0
    Home Country:
    Croatia Croatia
    Yup, FontEngine uses cached font glyph map to draw text. And branch creates new texture to draw text on and caches it (difference is that master uses default Arial font to draw text on texture, branch tries to use skin font).

    I presume difference could come from
    1. missing glyph in the font is output using first system font that has the character. But I doubt that would screw the spacing.
    Open your font in Character Map (windows program) and check if you have the right quotation mark char in the map?

    2. Difference between FontEngine draw and texture drawing: more likely.
     
  10. pilehave
    • Premium Supporter

    pilehave Community Skin Designer

    Joined:
    April 2, 2008
    Messages:
    2,566
    Likes Received:
    500
    Gender:
    Male
    Occupation:
    Technical consultant, marketing
    Location:
    Hornslet
    Ratings:
    +517 / 0
    Home Country:
    Denmark Denmark
    Sorry, the glyph is the right one. But there's still some calculation issues, I'll try and test some more.
     
  11. Lightning303
    • Premium Supporter

    Lightning303 MP Donator

    Joined:
    September 12, 2009
    Messages:
    798
    Likes Received:
    384
    Gender:
    Male
    Ratings:
    +578 / 0
    Home Country:
    Germany Germany
    Show System Specs
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!