simplify debug font lookup

This commit is contained in:
Konstantin Käfer
2014-10-30 17:36:28 -04:00
parent 8712beff80
commit 203acaad9e
2 changed files with 99 additions and 111 deletions

View File

@@ -12,19 +12,11 @@ void DebugFontBuffer::addText(const char *text, double left, double baseline, do
const size_t len = strlen(text);
for (size_t i = 0; i < len; ++i) {
if (text[i] < 32 || (unsigned char)(text[i]) > 127) {
if (text[i] < 32 || (unsigned char)(text[i]) >= 127) {
continue;
}
auto it = simplex.find((int)text[i]);
if (it == simplex.end()) {
continue;
}
const glyph& glyph = it->second;
if (!glyph.width) {
continue;
}
const glyph& glyph = simplex[text[i] - 32];
int16_t prev_x = -1, prev_y = -1, prev = false;
for (int32_t j = 0; j < glyph.length; j += 2) {