Bare metal VGA: render "italicized"/"Fraktur" text as normal text

This commit is contained in:
tkchia 2022-09-10 07:09:13 +00:00
parent fa82b57103
commit 036e07ef4a

View file

@ -146,66 +146,27 @@ static wchar_t *GetXlatLineDrawing(void) {
return xlat; return xlat;
} }
static void XlatAlphabet(wchar_t xlat[128], int a, int b) {
unsigned i;
for (i = 0; i < 128; ++i) {
if ('a' <= i && i <= 'z') {
xlat[i] = i - 'a' + a;
} else if ('A' <= i && i <= 'Z') {
xlat[i] = i - 'A' + b;
} else {
xlat[i] = i;
}
}
}
static wchar_t *GetXlatItalic(void) { static wchar_t *GetXlatItalic(void) {
static bool once; /* Unimplemented. Simply output normal non-italicized characters for now. */
static wchar_t xlat[128]; return GetXlatAscii();
if (!once) {
XlatAlphabet(xlat, L'𝑎', L'𝐴');
once = true;
}
return xlat;
} }
static wchar_t *GetXlatBoldItalic(void) { static wchar_t *GetXlatBoldItalic(void) {
static bool once; /*
static wchar_t xlat[128]; * Unimplemented. Simply output high-intensity non-italicized characters
if (!once) { * for now.
XlatAlphabet(xlat, L'𝒂', L'𝑨'); */
once = true; return GetXlatAscii();
}
return xlat;
} }
static wchar_t *GetXlatBoldFraktur(void) { static wchar_t *GetXlatBoldFraktur(void) {
static bool once; /* Unimplemented. */
static wchar_t xlat[128]; return GetXlatAscii();
if (!once) {
XlatAlphabet(xlat, L'𝖆', L'𝕬');
once = true;
}
return xlat;
} }
static wchar_t *GetXlatFraktur(void) { static wchar_t *GetXlatFraktur(void) {
unsigned i; /* Unimplemented. */
static bool once; return GetXlatAscii();
static wchar_t xlat[128];
if (!once) {
for (i = 0; i < ARRAYLEN(xlat); ++i) {
if ('A' <= i && i <= 'Z') {
xlat[i] = L"𝔄𝔅𝔇𝔈𝔉𝔊𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔𝔖𝔗𝔘𝔙𝔚𝔛𝔜"[i - 'A'];
} else if ('a' <= i && i <= 'z') {
xlat[i] = i - 'a' + L'𝔞';
} else {
xlat[i] = i;
}
}
once = true;
}
return xlat;
} }
static wchar_t *GetXlatDoubleWidth(void) { static wchar_t *GetXlatDoubleWidth(void) {