// calculate back buffer scale
data->monitorScale = win10_monitor_scale(hWnd);
- boolean bText = data->bAsciiMode || (u.uz.dlevel != 0 && Is_rogue_level(&u.uz));
+ boolean bText = data->bAsciiMode ||
+ (u.uz.dlevel != 0 && Is_rogue_level(&u.uz));
- if (bText) {
+ if (bText && !data->bFitToScreenMode)
data->backScale = data->monitorScale;
- } else {
+ else
data->backScale = 1.0;
- }
/* set back buffer tile size */
- data->xBackTile = (int) (data->tileWidth * data->backScale);
- data->yBackTile = (int) (data->tileHeight * data->backScale);
+ if (bText && data->bFitToScreenMode) {
+ data->xBackTile = wnd_size.cx / COLNO;
+ data->yBackTile = wnd_size.cy / ROWNO;
+ data->yBackTile = max(data->yBackTile, 12);
+ } else {
+ data->xBackTile = (int)(data->tileWidth * data->backScale);
+ data->yBackTile = (int)(data->tileHeight * data->backScale);
+ }
if (bText) {
LOGFONT lgfnt;
GetTextMetrics(data->backBufferDC, &textMetrics);
- if (textMetrics.tmHeight > data->yBackTile) {
- lgfnt.lfHeight++;
- continue;
- }
-
- if (textMetrics.tmAveCharWidth > data->xBackTile) {
- if (textMetrics.tmHeight > data->yBackTile &&
++ if ((textMetrics.tmHeight > data->yBackTile ||
++ textMetrics.tmAveCharWidth > data->xBackTile) &&
+ lgfnt.lfHeight < -MIN_FONT_HEIGHT) {
lgfnt.lfHeight++;
continue;
}