mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 03:10:27 +00:00
Bare metal VGA: render "italicized"/"Fraktur" text as normal text
This commit is contained in:
parent
fa82b57103
commit
036e07ef4a
1 changed files with 11 additions and 50 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue