include free HZK14/16 fonts

This commit is contained in:
Wengier
2021-07-14 02:39:33 -04:00
parent 7b6ceb505f
commit 1c3b316cf9
7 changed files with 45186 additions and 1 deletions

View File

@@ -21,8 +21,12 @@
- Non-Japanese DOS/V systems will now use 19-pixel
VGA fonts rather than 16-pixel VGA fonts for SBCS
characteres to look better. (Wengier)
- Free HZK14/HZK16 fonts are now included for the
Simplified Chinese DOS/V emulation. (Wengier)
- Improved the DOS/V font acquisition function on
the Linux platform (both SDL1 & SDL2). (Wengier)
the Linux platform (both SDL1 & SDL2). A config
option "usesysfont" is added which when set to
false will disable the font acquisiton. (Wengier)
- Added support for 14-pixel height fonts for the
DOS/V font system acquisition code. (nanshiki)
- Added support for inputing Japanese and Korean

View File

@@ -667,6 +667,7 @@ pc-98 anex86 font =
# mode that emulates text mode to display the characters and may be incompatible with non-Asian
# software that assumes direct access to the text mode via segment 0xB800.
# Possible values: off, jp, ko, chs, cht, cn, tw.
# getsysfont: If enabled, DOSBox-X will try to get and use the system fonts on Windows and Linux platforms for the DOS/V emulation.
# fontxsbcs: FONTX2 file used to rendering SBCS characters (8x19) in DOS/V or JEGA mode. If not specified, the default one will be used.
#DOSBOX-X-ADV:# fontxsbcs16: FONTX2 file used to rendering SBCS characters (8x16) in DOS/V mode.
#DOSBOX-X-ADV:# fontxsbcs24: FONTX2 file used to rendering SBCS characters (12x24) in DOS/V mode.
@@ -685,6 +686,7 @@ pc-98 anex86 font =
#DOSBOX-X-ADV-SEE:# -> fontxsbcs16; fontxsbcs24; fontxdbcs14; fontxdbcs24; del; vtext; vtext2
#DOSBOX-X-ADV-SEE:#
dosv = off
getsysfont = true
fontxsbcs =
#DOSBOX-X-ADV:fontxsbcs16 =
#DOSBOX-X-ADV:fontxsbcs24 =

View File

@@ -306,6 +306,7 @@ pc-98 anex86 font =
# mode that emulates text mode to display the characters and may be incompatible with non-Asian
# software that assumes direct access to the text mode via segment 0xB800.
# Possible values: off, jp, ko, chs, cht, cn, tw.
# getsysfont: If enabled, DOSBox-X will try to get and use the system fonts on Windows and Linux platforms for the DOS/V emulation.
# fontxsbcs: FONTX2 file used to rendering SBCS characters (8x19) in DOS/V or JEGA mode. If not specified, the default one will be used.
# fontxdbcs: FONTX2 file used to rendering DBCS characters (16x16) in DOS/V or JEGA mode. If not specified, the default one will be used.
# gbk: Enables the GBK extension (in addition to the standard GB2312 charset) for the Simplified Chinese DOS/V emulation or TTF output.
@@ -317,6 +318,7 @@ pc-98 anex86 font =
# -> fontxsbcs16; fontxsbcs24; fontxdbcs14; fontxdbcs24; del; vtext; vtext2
#
dosv = off
getsysfont = true
fontxsbcs =
fontxdbcs =
gbk = false

View File

@@ -647,6 +647,7 @@ pc-98 show graphics layer on initialize = true
# mode that emulates text mode to display the characters and may be incompatible with non-Asian
# software that assumes direct access to the text mode via segment 0xB800.
# Possible values: off, jp, ko, chs, cht, cn, tw.
# getsysfont: If enabled, DOSBox-X will try to get and use the system fonts on Windows and Linux platforms for the DOS/V emulation.
# fontxsbcs: FONTX2 file used to rendering SBCS characters (8x19) in DOS/V or JEGA mode. If not specified, the default one will be used.
# fontxsbcs16: FONTX2 file used to rendering SBCS characters (8x16) in DOS/V mode.
# fontxsbcs24: FONTX2 file used to rendering SBCS characters (12x24) in DOS/V mode.
@@ -661,6 +662,7 @@ pc-98 show graphics layer on initialize = true
# vtext: V-text screen mode for the DOS/V emulation.
# vtext2: V-text screen mode 2 for the DOS/V emulation.
dosv = off
getsysfont = true
fontxsbcs =
fontxsbcs16 =
fontxsbcs24 =

File diff suppressed because it is too large Load Diff

View File

@@ -2032,6 +2032,10 @@ void DOSBOX_SetupConfigSections(void) {
"software that assumes direct access to the text mode via segment 0xB800.");
Pstring->SetBasic(true);
Pbool = secprop->Add_bool("getsysfont",Property::Changeable::OnlyAtStart,true);
Pbool->Set_help("If enabled, DOSBox-X will try to get and use the system fonts on Windows and Linux platforms for the DOS/V emulation.");
Pbool->SetBasic(true);
//For loading FONTX CJK fonts
Pstring = secprop->Add_path("fontxsbcs",Property::Changeable::OnlyAtStart,"");
Pstring->Set_help("FONTX2 file used to rendering SBCS characters (8x19) in DOS/V or JEGA mode. If not specified, the default one will be used.");

View File

@@ -106,6 +106,7 @@ bool gbk = false;
bool del_flag = true;
bool yen_flag = false;
bool jfont_init = false;
bool getsysfont = true;
uint8_t TrueVideoMode;
void ResolvePath(std::string& in);
void SetIMPosition();
@@ -272,6 +273,7 @@ static bool CheckEmptyData(uint8_t *data, Bitu length)
bool GetWindowsFont(Bitu code, uint8_t *buff, int width, int height)
{
if (!getsysfont) return false;
#if defined(LINUX) && C_X11
XRectangle ir, lr;
XImage *image;
@@ -459,6 +461,14 @@ uint8_t *GetDbcsFont(Bitu code)
memcpy(&jfont_dbcs_16[code * 32], jfont_dbcs, 32);
jfont_cache_dbcs_16[code] = 1;
} else {
if (dos.loaded_codepage == 936 && (code/0x100)>0xa0 && (code/0x100)<0xff) {
int offset = (94 * (unsigned int)((code/0x100) - 0xa0 - 1) + ((code%0x100) - 0xa0 - 1)) * 32;
if (offset + 32 <= sizeof(hzk16_data)) {
memcpy(&jfont_dbcs_16[code * 32], hzk16_data+offset, 32);
jfont_cache_dbcs_16[code] = 1;
return &jfont_dbcs_16[code * 32];
}
}
if (!IS_JDOSV && (dos.loaded_codepage == 936 || dos.loaded_codepage == 949 || dos.loaded_codepage == 950))
code = GetConvertedCode(code);
int p = NAME_LEN+ID_LEN+3;
@@ -497,6 +507,14 @@ uint8_t *GetDbcs14Font(Bitu code, bool &is14)
is14 = true;
return jfont_dbcs;
} else {
if (dos.loaded_codepage == 936 && (code/0x100)>0xa0 && (code/0x100)<0xff) {
int offset = (94 * (unsigned int)((code/0x100) - 0xa0 - 1) + ((code%0x100) - 0xa0 - 1)) * 28;
if (offset + 28 <= sizeof(hzk14_data)) {
memcpy(&jfont_dbcs_14[code * 28], hzk14_data+offset, 28);
jfont_cache_dbcs_14[code] = 1;
return &jfont_dbcs_14[code * 28];
}
}
if (!IS_JDOSV && (dos.loaded_codepage == 936 || dos.loaded_codepage == 949 || dos.loaded_codepage == 950))
code = GetConvertedCode(code);
int p = NAME_LEN+ID_LEN+3;
@@ -679,6 +697,7 @@ void JFONT_Init() {
SDL_SetCompositionFontName(jfont_name);
#endif
Section_prop *section = static_cast<Section_prop *>(control->GetSection("dosv"));
getsysfont = section->Get_bool("getsysfont");
yen_flag = section->Get_bool("yen");
Prop_path* pathprop = section->Get_path("fontxsbcs");