mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
allow to specify min size for anti-aliased fonts
This commit is contained in:
parent
2e22226caf
commit
5ebda1fec7
@ -367,7 +367,7 @@ static void cfg_create_ini()
|
|||||||
"rgb555=false\n"
|
"rgb555=false\n"
|
||||||
"no_dinput_hook=false\n"
|
"no_dinput_hook=false\n"
|
||||||
"refresh_rate=0\n"
|
"refresh_rate=0\n"
|
||||||
"non_anti_aliased_fonts=true\n"
|
"anti_aliased_fonts_min_size=13\n"
|
||||||
"custom_width=0\n"
|
"custom_width=0\n"
|
||||||
"custom_height=0\n"
|
"custom_height=0\n"
|
||||||
"min_font_size=0\n"
|
"min_font_size=0\n"
|
||||||
|
@ -910,7 +910,15 @@ HFONT WINAPI fake_CreateFontIndirectA(CONST LOGFONTA* lplf)
|
|||||||
LOGFONTA lf;
|
LOGFONTA lf;
|
||||||
memcpy(&lf, lplf, sizeof(lf));
|
memcpy(&lf, lplf, sizeof(lf));
|
||||||
|
|
||||||
if (cfg_get_bool("non_anti_aliased_fonts", TRUE))
|
int minFontSize = cfg_get_int("min_font_size", 0);
|
||||||
|
if (lf.lfHeight < 0) {
|
||||||
|
lf.lfHeight = min(-minFontSize, lf.lfHeight);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lf.lfHeight = max(minFontSize, lf.lfHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cfg_get_int("anti_aliased_fonts_min_size", 13) > abs(lf.lfHeight))
|
||||||
lf.lfQuality = NONANTIALIASED_QUALITY;
|
lf.lfQuality = NONANTIALIASED_QUALITY;
|
||||||
|
|
||||||
return real_CreateFontIndirectA(&lf);
|
return real_CreateFontIndirectA(&lf);
|
||||||
@ -932,9 +940,6 @@ HFONT WINAPI fake_CreateFontA(
|
|||||||
DWORD fdwPitchAndFamily,
|
DWORD fdwPitchAndFamily,
|
||||||
LPCTSTR lpszFace)
|
LPCTSTR lpszFace)
|
||||||
{
|
{
|
||||||
if (cfg_get_bool("non_anti_aliased_fonts", TRUE))
|
|
||||||
fdwQuality = NONANTIALIASED_QUALITY;
|
|
||||||
|
|
||||||
int minFontSize = cfg_get_int("min_font_size", 0);
|
int minFontSize = cfg_get_int("min_font_size", 0);
|
||||||
if (nHeight < 0) {
|
if (nHeight < 0) {
|
||||||
nHeight = min(-minFontSize, nHeight);
|
nHeight = min(-minFontSize, nHeight);
|
||||||
@ -943,6 +948,9 @@ HFONT WINAPI fake_CreateFontA(
|
|||||||
nHeight = max(minFontSize, nHeight);
|
nHeight = max(minFontSize, nHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg_get_int("anti_aliased_fonts_min_size", 13) > abs(nHeight))
|
||||||
|
fdwQuality = NONANTIALIASED_QUALITY;
|
||||||
|
|
||||||
return
|
return
|
||||||
real_CreateFontA(
|
real_CreateFontA(
|
||||||
nHeight,
|
nHeight,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user