bug 909344 - render stray control characters as hexboxes instead of invisible. r=roc

This commit is contained in:
Jonathan Kew 2013-08-26 16:32:55 -07:00
parent f477146890
commit 45314d379f

View File

@ -3344,11 +3344,14 @@ gfxFont::ShapeTextWithoutWordCache(gfxContext *aContext,
}
// fragment was terminated by an invalid char: skip it,
// unless it's a control char that we want to show as a hexbox,
// but record where TAB or NEWLINE occur
if (ch == '\t') {
aTextRun->SetIsTab(aOffset + i);
} else if (ch == '\n') {
aTextRun->SetIsNewline(aOffset + i);
} else if ((ch & 0x7f) < 0x20 || ch == 0x7f) {
aTextRun->SetMissingGlyph(aOffset + i, ch, this);
}
fragStart = i + 1;
}
@ -3485,11 +3488,14 @@ gfxFont::SplitAndInitTextRun(gfxContext *aContext,
"how did we get here except via an invalid char?");
// word was terminated by an invalid char: skip it,
// unless it's a control char that we want to show as a hexbox,
// but record where TAB or NEWLINE occur
if (ch == '\t') {
aTextRun->SetIsTab(aRunStart + i);
} else if (ch == '\n') {
aTextRun->SetIsNewline(aRunStart + i);
} else if ((ch & 0x7f) < 0x20 || ch == 0x7f) {
aTextRun->SetMissingGlyph(aRunStart + i, ch, this);
}
hash = 0;