add Bold and underline in TextRenderer

This commit is contained in:
Shaohua Tong 2019-11-19 17:47:26 +01:00
parent f9aa3e35b0
commit c719c8f655
1 changed files with 11 additions and 13 deletions

View File

@ -56,15 +56,18 @@ bool** TextRenderer::getCharacter(unsigned char character, Font font) {
void TextRenderer::fontProcessing(bool **characterBitmap) {
if(isBold()) {
for (int i = fontHeight - 1; i >= 0; i--) {
for (int j = fontWidth - 1; j >= 0; j--) {
if (i != fontHeight - 1 && j != fontWidth - 1 && characterBitmap[i][j]) {
characterBitmap[i + 1][j] = true;
characterBitmap[i][j + 1] = true;
}
}
}
if(isItalics()) {
}
if(isUnderline()) {
for (int j = 0; j < fontWidth; j++)
characterBitmap[fontHeight - 1][j] = true;
}
}
@ -72,10 +75,6 @@ bool TextRenderer::isBold() {
return type & BOLD != 0;
}
bool TextRenderer::isItalics() {
return type & ITALICS != 0;
}
bool TextRenderer::isUnderline() {
return type & UNDERLINE != 0;
}
@ -97,4 +96,3 @@ void TextRenderer::translateToSharedMemory(bool **characterBitmap, int startX, i
currentY++;
}
}