From: H.G.Muller Date: Wed, 6 Apr 2016 08:49:53 +0000 (+0200) Subject: Put fonts in font table in allocated memory after sizing X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=12386b8e128f848b3c1aecbca88e763e696a78bd;p=xboard.git Put fonts in font table in allocated memory after sizing To make it possible to change the font later it should always be put in allocated memory. --- diff --git a/gtk/xboard.c b/gtk/xboard.c index c68d85f..c6579d8 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -1693,9 +1693,9 @@ ReSize (WindowPlacement *wp) for(h=0; sizeDefaults[h].name && sizeDefaults[h].squareSize*8 > sqx*BOARD_WIDTH; h++) {} if(initialSquareSize != sizeDefaults[h].squareSize) { // boardSize changed initialSquareSize = sizeDefaults[h].squareSize; // used for saving font - if(!fontValid[CLOCK_FONT][initialSquareSize]) fontTable[CLOCK_FONT][initialSquareSize] = CLOCK_FONT_NAME; + if(!fontValid[CLOCK_FONT][initialSquareSize]) { ASSIGN(fontTable[CLOCK_FONT][initialSquareSize], CLOCK_FONT_NAME); } appData.clockFont = InsertPxlSize(fontTable[CLOCK_FONT][initialSquareSize], 2*(sizeDefaults[h].clockFontPxlSize+1)/3); - if(!fontValid[MESSAGE_FONT][initialSquareSize]) fontTable[MESSAGE_FONT][initialSquareSize] = DEFAULT_FONT_NAME; + if(!fontValid[MESSAGE_FONT][initialSquareSize]) { ASSIGN(fontTable[MESSAGE_FONT][initialSquareSize], DEFAULT_FONT_NAME); } appData.font = InsertPxlSize(fontTable[MESSAGE_FONT][initialSquareSize], sizeDefaults[h].coordFontPxlSize); DisplayBothClocks(); ApplyFont(&mainOptions[W_MESSG], NULL);