From 3854445a367eb023961ce3834dc01c50dfcef20f Mon Sep 17 00:00:00 2001
From: H.G.Muller <hgm@hgm-xboard.(none)>
Date: Wed, 6 Apr 2016 16:08:24 +0200
Subject: [PATCH] Apply fonts in 'other windows' after sizing

---
 dialogs.c    |    3 +--
 dialogs.h    |    1 +
 gtk/xboard.c |   10 ++++++++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/dialogs.c b/dialogs.c
index 039232d..f138bb7 100644
--- a/dialogs.c
+++ b/dialogs.c
@@ -1223,7 +1223,7 @@ NewMove ()
     addToBookFlag = !addToBookFlag;
 }
 
-static Option tagsOptions[] = {
+Option tagsOptions[] = {
 {   0,   0,   0, NULL, NULL, NULL, NULL, Label,  NULL },
 { 200, T_VSCRL | T_FILL | T_WRAP | T_TOP, 200, NULL, (void*) &tagsText, NULL, (char **) &TagsClick, TextBox, "", &appData.tagsFont },
 {   0,   0, 100, NULL, (void*) &NewMove,    NULL, NULL, Button, N_("add next move") },
@@ -1638,7 +1638,6 @@ NewFont (int n, int fnr, char *font)
 static int
 FontsOK (int n)
 {
-    extern Option historyOptions[], engoutOptions[], gamesOptions[], chatOptions[];
     int i;
     PopDown(TransientDlg); // Early popdown to prevent expose events frommasking each other
     LockBoardSize(0);
diff --git a/dialogs.h b/dialogs.h
index 65e7b59..a0b8cf6 100644
--- a/dialogs.h
+++ b/dialogs.h
@@ -133,6 +133,7 @@ extern WindowPlacement wpComment, wpTags, wpMoveHistory, wpMain, wpDualBoard, wp
 extern char *marked[];
 extern Boolean shellUp[];
 extern Option textOptions[], typeOptions[], dualOptions[], mainOptions[];
+extern Option historyOptions[], engoutOptions[], gamesOptions[], chatOptions[], tagsOptions[], commentOptions[];
 #define MAX_SIZE 130
 extern Boolean fontIsSet[], fontValid[][MAX_SIZE];
 extern int initialSquareSize;
diff --git a/gtk/xboard.c b/gtk/xboard.c
index 5498622..ad3cd5a 100644
--- a/gtk/xboard.c
+++ b/gtk/xboard.c
@@ -256,7 +256,7 @@ GtkAccelGroup *GtkAccelerators;
 typedef unsigned int BoardSize;
 BoardSize boardSize;
 Boolean chessProgram;
-static int initialSquareSize;
+int initialSquareSize;
 
 int  minX, minY; // [HGM] placement: volatile limits on upper-left corner
 int smallLayout = 0, tinyLayout = 0,
@@ -381,7 +381,6 @@ colorVariable[] = {
 
 // [HGM] font: keep a font for each square size, even non-stndard ones
 #define NUM_SIZES 18
-#define MAX_SIZE 130
 Boolean fontIsSet[NUM_FONTS], fontValid[NUM_FONTS][MAX_SIZE];
 char *fontTable[NUM_FONTS][MAX_SIZE];
 
@@ -1715,6 +1714,13 @@ ReSize (WindowPlacement *wp)
 	    DisplayBothClocks();
 	    ApplyFont(&mainOptions[W_MESSG], NULL);
 	    for(i=1; i<6; i++) ApplyFont(&mainOptions[W_BUTTON+i], NULL);
+	    ApplyFont(&tagsOptions[1], NULL);
+	    ApplyFont(&commentOptions[0], NULL);
+	    ApplyFont(&historyOptions[0], NULL);
+	    ApplyFont(&engoutOptions[5], NULL);
+	    ApplyFont(&engoutOptions[12], NULL);
+	    ApplyFont(&chatOptions[11], appData.icsFont);
+	    AppendColorized(&chatOptions[6], NULL, 0); // kludge to replace font tag
 	}
 	if(!strchr(appData.boardSize, ',')) {
 	    ASSIGN(appData.boardSize, sizeDefaults[h].name);
-- 
1.7.0.4