More font hackery. Will it ever end?

Fixes #1606
deque
scrawl 11 years ago
parent 0a2d5d34bc
commit a3a8f4da70

@ -260,21 +260,28 @@ namespace MWGui
// More hacks! The french game uses several win1252 characters that are not included // More hacks! The french game uses several win1252 characters that are not included
// in the cp437 encoding of the font. Fall back to similar available characters. // in the cp437 encoding of the font. Fall back to similar available characters.
// Same for U+2013 if (mEncoding == ToUTF8::CP437)
std::map<int, int> additional;
additional[39] = 0x2019; // apostrophe
additional[45] = 0x2013; // dash
if (additional.find(i) != additional.end() && mEncoding == ToUTF8::CP437)
{ {
MyGUI::xml::ElementPtr code = codes->createChild("Code"); std::multimap<int, int> additional;
code->addAttribute("index", additional[i]); additional.insert(std::make_pair(39, 0x2019)); // apostrophe
code->addAttribute("coord", MyGUI::utility::toString(x1) + " " additional.insert(std::make_pair(45, 0x2013)); // dash
+ MyGUI::utility::toString(y1) + " " additional.insert(std::make_pair(34, 0x201D)); // right double quotation mark
+ MyGUI::utility::toString(w) + " " additional.insert(std::make_pair(34, 0x201C)); // left double quotation mark
+ MyGUI::utility::toString(h)); for (std::multimap<int, int>::iterator it = additional.begin(); it != additional.end(); ++it)
code->addAttribute("advance", data[i].width); {
code->addAttribute("bearing", MyGUI::utility::toString(data[i].kerning) + " " if (it->first != i)
+ MyGUI::utility::toString((fontSize-data[i].ascent))); continue;
MyGUI::xml::ElementPtr code = codes->createChild("Code");
code->addAttribute("index", it->second);
code->addAttribute("coord", MyGUI::utility::toString(x1) + " "
+ MyGUI::utility::toString(y1) + " "
+ MyGUI::utility::toString(w) + " "
+ MyGUI::utility::toString(h));
code->addAttribute("advance", data[i].width);
code->addAttribute("bearing", MyGUI::utility::toString(data[i].kerning) + " "
+ MyGUI::utility::toString((fontSize-data[i].ascent)));
}
} }
// ASCII vertical bar, use this as text input cursor // ASCII vertical bar, use this as text input cursor

Loading…
Cancel
Save