mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 10:41:12 +00:00
wineconsole: Accept a too large font if we can't find one that fits the screen.
This commit is contained in:
parent
15f8b01223
commit
8e77d6a24d
3 changed files with 15 additions and 9 deletions
|
@ -300,7 +300,7 @@ static int CALLBACK font_enum_size2(const LOGFONTW* lf, const TEXTMETRICW* tm,
|
||||||
struct dialog_info* di = (struct dialog_info*)lParam;
|
struct dialog_info* di = (struct dialog_info*)lParam;
|
||||||
|
|
||||||
WCUSER_DumpTextMetric(tm, FontType);
|
WCUSER_DumpTextMetric(tm, FontType);
|
||||||
if (WCUSER_ValidateFontMetric(di->data, tm, FontType))
|
if (WCUSER_ValidateFontMetric(di->data, tm, FontType, TRUE))
|
||||||
{
|
{
|
||||||
di->nFont++;
|
di->nFont++;
|
||||||
}
|
}
|
||||||
|
@ -372,7 +372,7 @@ static int CALLBACK font_enum_size(const LOGFONTW* lf, const TEXTMETRICW* tm,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WCUSER_ValidateFontMetric(di->data, tm, FontType))
|
if (WCUSER_ValidateFontMetric(di->data, tm, FontType, TRUE))
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,8 @@ static BOOL WCUSER_AreFontsEqual(const struct config_data* config, const LOGFONT
|
||||||
struct font_chooser
|
struct font_chooser
|
||||||
{
|
{
|
||||||
struct inner_data* data;
|
struct inner_data* data;
|
||||||
int done;
|
BOOL check_screen_size;
|
||||||
|
BOOL done;
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
|
@ -341,11 +342,12 @@ struct font_chooser
|
||||||
*
|
*
|
||||||
* Returns true if the font described in tm is usable as a font for the renderer
|
* Returns true if the font described in tm is usable as a font for the renderer
|
||||||
*/
|
*/
|
||||||
BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, const TEXTMETRICW* tm, DWORD fontType)
|
BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, const TEXTMETRICW* tm,
|
||||||
|
DWORD type, BOOL check_screen_size)
|
||||||
{
|
{
|
||||||
BOOL ret = TRUE;
|
BOOL ret = TRUE;
|
||||||
|
|
||||||
if (fontType & RASTER_FONTTYPE)
|
if (check_screen_size && (type & RASTER_FONTTYPE))
|
||||||
ret = (tm->tmMaxCharWidth * data->curcfg.win_width < GetSystemMetrics(SM_CXSCREEN) &&
|
ret = (tm->tmMaxCharWidth * data->curcfg.win_width < GetSystemMetrics(SM_CXSCREEN) &&
|
||||||
tm->tmHeight * data->curcfg.win_height < GetSystemMetrics(SM_CYSCREEN));
|
tm->tmHeight * data->curcfg.win_height < GetSystemMetrics(SM_CYSCREEN));
|
||||||
return ret && !tm->tmItalic && !tm->tmUnderlined && !tm->tmStruckOut &&
|
return ret && !tm->tmItalic && !tm->tmUnderlined && !tm->tmStruckOut &&
|
||||||
|
@ -377,7 +379,7 @@ static int CALLBACK get_first_font_enum_2(const LOGFONTW* lf, const TEXTMETRICW*
|
||||||
struct font_chooser* fc = (struct font_chooser*)lParam;
|
struct font_chooser* fc = (struct font_chooser*)lParam;
|
||||||
|
|
||||||
WCUSER_DumpTextMetric(tm, FontType);
|
WCUSER_DumpTextMetric(tm, FontType);
|
||||||
if (WCUSER_ValidateFontMetric(fc->data, tm, FontType))
|
if (WCUSER_ValidateFontMetric(fc->data, tm, FontType, fc->check_screen_size))
|
||||||
{
|
{
|
||||||
LOGFONTW mlf = *lf;
|
LOGFONTW mlf = *lf;
|
||||||
|
|
||||||
|
@ -535,7 +537,11 @@ static void WCUSER_SetFontPmt(struct inner_data* data, const WCHAR* font,
|
||||||
/* try to find an acceptable font */
|
/* try to find an acceptable font */
|
||||||
WINE_WARN("Couldn't match the font from registry... trying to find one\n");
|
WINE_WARN("Couldn't match the font from registry... trying to find one\n");
|
||||||
fc.data = data;
|
fc.data = data;
|
||||||
fc.done = 0;
|
fc.check_screen_size = TRUE;
|
||||||
|
fc.done = FALSE;
|
||||||
|
EnumFontFamiliesW(PRIVATE(data)->hMemDC, NULL, get_first_font_enum, (LPARAM)&fc);
|
||||||
|
if (fc.done) return;
|
||||||
|
fc.check_screen_size = FALSE;
|
||||||
EnumFontFamiliesW(PRIVATE(data)->hMemDC, NULL, get_first_font_enum, (LPARAM)&fc);
|
EnumFontFamiliesW(PRIVATE(data)->hMemDC, NULL, get_first_font_enum, (LPARAM)&fc);
|
||||||
if (!fc.done) WINECON_Fatal("Couldn't find a decent font, aborting\n");
|
if (!fc.done) WINECON_Fatal("Couldn't find a decent font, aborting\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,8 @@ struct inner_data_user {
|
||||||
extern const COLORREF WCUSER_ColorMap[16];
|
extern const COLORREF WCUSER_ColorMap[16];
|
||||||
extern BOOL WCUSER_GetProperties(struct inner_data*, BOOL);
|
extern BOOL WCUSER_GetProperties(struct inner_data*, BOOL);
|
||||||
extern BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONTW* lf);
|
extern BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONTW* lf);
|
||||||
extern BOOL WCUSER_ValidateFontMetric(const struct inner_data* data,
|
extern BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, const TEXTMETRICW* tm,
|
||||||
const TEXTMETRICW* tm, DWORD fontType);
|
DWORD type, BOOL check_screen_size);
|
||||||
extern HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd,
|
extern HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd,
|
||||||
const LOGFONTW* lf, LONG* el);
|
const LOGFONTW* lf, LONG* el);
|
||||||
extern void WCUSER_FillLogFont(LOGFONTW* lf, const WCHAR* name,
|
extern void WCUSER_FillLogFont(LOGFONTW* lf, const WCHAR* name,
|
||||||
|
|
Loading…
Reference in a new issue