From 9a84c7596671bd085afc8d927f9d0a38c2cff13f Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sun, 3 Apr 2016 10:23:49 +0200 Subject: [PATCH] Save font settings based on initial square size Font settings were saved by the square size as it was at the time of saving, which could have been altered compared to the reading of the fonts from the settings file by interactive sizing of the window, or by switching to a variant with other board dimensions. Now the initial square size is remembered and used for this. BEWARE: we might want to undo this when window sizing would affect font selection, rather than just sizing the board. --- gtk/xboard.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gtk/xboard.c b/gtk/xboard.c index 5e2314a..a7b10ca 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -256,6 +256,7 @@ GtkAccelGroup *GtkAccelerators; typedef unsigned int BoardSize; BoardSize boardSize; Boolean chessProgram; +static int initialSquareSize; int minX, minY; // [HGM] placement: volatile limits on upper-left corner int smallLayout = 0, tinyLayout = 0, @@ -516,9 +517,9 @@ SaveFontArg (FILE *f, ArgDescriptor *ad) return; } for(i=0; itinyLayout; // [HGM] font: use defaults from settings file if available and not overruled } + initialSquareSize = squareSize; // [HGM] remember for saving font info if(BOARD_WIDTH != 8) { squareSize = (squareSize*8 + BOARD_WIDTH/2)/BOARD_WIDTH; // keep width the same lineGap = (squareSize < 37 ? 1 : squareSize < 59 ? 2 : squareSize < 116 ? 3 : 4); -- 1.7.0.4