From 12386b8e128f848b3c1aecbca88e763e696a78bd Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 6 Apr 2016 10:49:53 +0200 Subject: [PATCH] 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. --- gtk/xboard.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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); -- 1.7.0.4