add Bold and underline in TextRenderer
This commit is contained in:
parent
f9aa3e35b0
commit
c719c8f655
|
@ -56,15 +56,18 @@ bool** TextRenderer::getCharacter(unsigned char character, Font font) {
|
||||||
|
|
||||||
void TextRenderer::fontProcessing(bool **characterBitmap) {
|
void TextRenderer::fontProcessing(bool **characterBitmap) {
|
||||||
if(isBold()) {
|
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()) {
|
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;
|
return type & BOLD != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextRenderer::isItalics() {
|
|
||||||
return type & ITALICS != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TextRenderer::isUnderline() {
|
bool TextRenderer::isUnderline() {
|
||||||
return type & UNDERLINE != 0;
|
return type & UNDERLINE != 0;
|
||||||
}
|
}
|
||||||
|
@ -96,5 +95,4 @@ void TextRenderer::translateToSharedMemory(bool **characterBitmap, int startX, i
|
||||||
currentX = startX;
|
currentX = startX;
|
||||||
currentY++;
|
currentY++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue