I'll try and look into it one of these days. Unfortunately XBMC uses C++ and a totally re-writte font-system, so it won't be easy.
public bool containsOutOfBoundsChar(string text)
{
for (int i = 0; i < text.Length; ++i)
{
char c = text[i];
if ((c < _StartCharacter || c >= _EndCharacter) && c != '\n')
{
Log.Info("containsOutOfBoundsChar:" + c);
return true;
}
}
return false;
}
219 // remaps unsupported font glpyhs to other suitable ones
220 wchar_t CGUIFont::RemapGlyph(wchar_t letter)
221 {
222 if (letter == 0x2019 || letter == 0x2018) return 0x0027; // single quotes
223 else if (letter == 0x201c || letter == 0x201d) return 0x0022;
224 return 0; // no decent character map
225 }
Cool, would be nice to do for all the problematic characters:XBMC font-code has this interesting part;
Code:219 // remaps unsupported font glpyhs to other suitable ones 220 wchar_t CGUIFont::RemapGlyph(wchar_t letter) 221 { 222 if (letter == 0x2019 || letter == 0x2018) return 0x0027; // single quotes 223 else if (letter == 0x201c || letter == 0x201d) return 0x0022; 224 return 0; // no decent character map 225 }
Seems like they have had problems with single quotes as well (both left and right).
I'll test a fix...
text = text.Replace("‘", "'");
text = text.Replace("’", "'");
I don't know how to get the HEX values, from all the testing I did, I only found that the strings are handled as...strings.
Putting this in a few places in GUIFont.cs, fixes the problem for me (fixes as in replaces single left/right quotation mark with apostrophe):
Code:text = text.Replace("‘", "'"); text = text.Replace("’", "'");
Obviously that's not very clean, but it works. I would rather have normal looking apostrophe than weird looking right single quotation mark
I don't know how to get the HEX values, from all the testing I did, I only found that the strings are handled as...strings.
Putting this in a few places in GUIFont.cs, fixes the problem for me (fixes as in replaces single left/right quotation mark with apostrophe):
Code:text = text.Replace("‘", "'"); text = text.Replace("’", "'");
Obviously that's not very clean, but it works. I would rather have normal looking apostrophe than weird looking right single quotation mark
Also it is highly inefficient to run that replace on rendering pass. At least I would assume it gets done there. Much better way (still a hack) would be to replace the content that is passed to the GUI controls.