From: H.G.Muller Date: Sun, 3 Apr 2016 08:23:49 +0000 (+0200) Subject: Save font settings based on initial square size X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=9a84c7596671bd085afc8d927f9d0a38c2cff13f 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. --- 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);