}
Option commentOptions[] = {
-{ 200, T_VSCRL | T_FILL | T_WRAP | T_TOP, 250, NULL, (void*) &commentText, "", (char **) &CommentClick, TextBox, "" },
+{ 200, T_VSCRL | T_FILL | T_WRAP | T_TOP, 250, NULL, (void*) &commentText, (char*) &appData.commentFont, (char **) &CommentClick, TextBox, "" },
{ 0, 0, 50, NULL, (void*) &ClearComment, NULL, NULL, Button, N_("clear") },
{ 0, SAME_ROW, 100, NULL, (void*) &SaveChanges, NULL, NULL, Button, N_("save changes") },
{ 0, SAME_ROW, 0, NULL, (void*) &NewComCallback, "", NULL, EndMark , "" }
static Option tagsOptions[] = {
{ 0, 0, 0, NULL, NULL, NULL, NULL, Label, NULL },
-{ 200, T_VSCRL | T_FILL | T_WRAP | T_TOP, 200, NULL, (void*) &tagsText, "", (char **) &TagsClick, TextBox, "" },
+{ 200, T_VSCRL | T_FILL | T_WRAP | T_TOP, 200, NULL, (void*) &tagsText, (char*) &appData.tagsFont, (char **) &TagsClick, TextBox, "" },
{ 0, 0, 100, NULL, (void*) &NewMove, NULL, NULL, Button, N_("add next move") },
{ 0,SAME_ROW,100,NULL, (void*) &changeTags, NULL, NULL, Button, N_("save changes") },
{ 0,SAME_ROW, 0, NULL, (void*) &NewTagsCallback, "", NULL, EndMark , "" }
// int max X/E (w) (w) (w) (w) (w) (w) (w) (w)
// void* handle X/E X/E X/E X/E X/E X X X X X
// void* target X X X X/C C X X C C
-// char* textValue E X/E *
-// char ** choice X/E * X
+// char* textValue X/E X/E *
+// char ** choice C X/E * X
// enum type X/E X/E X/E X/E X X X X X X X X
// char[] name X/E X/E X/E X/E X X X X X
// File and Path options are like String (but get a browse button added in the dialog), and Slider
// defer processing it until we know if it matches our board size
if(!strstr(name, "-*-") && // ignore X-fonts
size >= 0 && size<MAX_SIZE) { // for now, fixed limit
- fontTable[number][size] = strdup(strchr(name, ':')+1);
+ fontTable[number][size] = name = strdup(strchr(name, ':')+1);
fontValid[number][size] = True;
- }
- return;
+ } else return;
}
switch(number) {
case 0: // CLOCK_FONT
case 2: // COORD_FONT
appData.coordFont = strdup(name);
break;
+ case CONSOLE_FONT:
+ appData.icsFont = strdup(name);
+ break;
+ case EDITTAGS_FONT:
+ appData.tagsFont = strdup(name);
+ break;
+ case COMMENT_FONT:
+ appData.commentFont = strdup(name);
+ break;
+ case MOVEHISTORY_FONT:
+ appData.historyFont = strdup(name);
+ break;
+ case GAMELIST_FONT:
+ appData.gameListFont = strdup(name);
+ break;
default:
return;
}
void
SetFontDefaults ()
{ // only 2 fonts currently
- appData.clockFont = CLOCK_FONT_NAME;
- appData.coordFont = COORD_FONT_NAME;
- appData.font = DEFAULT_FONT_NAME;
+ appData.clockFont = strdup(CLOCK_FONT_NAME);
+ appData.coordFont = strdup(COORD_FONT_NAME);
+ appData.font = strdup(DEFAULT_FONT_NAME);
+ appData.icsFont = strdup(CONSOLE_FONT_NAME);
+ appData.tagsFont = strdup(TAGS_FONT_NAME);
+ appData.commentFont = strdup(COMMENT_FONT_NAME);
+ appData.historyFont = strdup(HISTORY_FONT_NAME);
+ appData.gameListFont = strdup(GAMELIST_FONT_NAME);
}
void
case 2: // COORD_FONT
name = appData.coordFont;
break;
+ case CONSOLE_FONT:
+ name = appData.icsFont;
+ break;
+ case EDITTAGS_FONT:
+ name = appData.tagsFont;
+ break;
+ case COMMENT_FONT:
+ name = appData.commentFont;
+ break;
+ case MOVEHISTORY_FONT:
+ name = appData.historyFont;
+ break;
+ case GAMELIST_FONT:
+ name = appData.gameListFont;
+ break;
default:
return;
}
appData.font = fontTable[MESSAGE_FONT][squareSize];
if(!fontIsSet[COORD_FONT] && fontValid[COORD_FONT][squareSize])
appData.coordFont = fontTable[COORD_FONT][squareSize];
+ if(!fontIsSet[CONSOLE_FONT] && fontValid[CONSOLE_FONT][squareSize])
+ appData.icsFont = fontTable[CONSOLE_FONT][squareSize];
+ if(!fontIsSet[COMMENT_FONT] && fontValid[COMMENT_FONT][squareSize])
+ appData.commentFont = fontTable[COMMENT_FONT][squareSize];
appData.font = InsertPxlSize(appData.font, fontPxlSize);
appData.clockFont = InsertPxlSize(appData.clockFont, clockFontPxlSize);
appData.coordFont = InsertPxlSize(appData.coordFont, coordFontPxlSize);
+ appData.icsFont = InsertPxlSize(appData.icsFont, fontPxlSize);
+ appData.tagsFont = InsertPxlSize(appData.tagsFont, fontPxlSize);
+ appData.commentFont = InsertPxlSize(appData.commentFont, fontPxlSize);
+ appData.historyFont = InsertPxlSize(appData.historyFont, fontPxlSize);
+ appData.gameListFont = InsertPxlSize(appData.gameListFont, fontPxlSize);
#ifdef TODO_GTK
XrmValue vTo;
static GtkTextTag *fgTags[8], *bgTags[8], *font, *bold, *normal, *attr = NULL;
if(!font) {
- font = gtk_text_buffer_create_tag(opt->handle, NULL, "font", "Monospace normal", NULL);
+ font = gtk_text_buffer_create_tag(opt->handle, NULL, "font", appData.icsFont, NULL);
gtk_widget_modify_base(GTK_WIDGET(opt->textValue), GTK_STATE_NORMAL, &backgroundColor);
}
/* no label so let textview occupy all columns */
Pack(hbox, table, sw, left, left+r, top, GTK_EXPAND);
}
+ if ( option[i].textValue != NULL ) {
+ PangoFontDescription *pfd;
+ pfd = pango_font_description_from_string(*(char**)option[i].textValue);
+ gtk_widget_modify_font(textview, pfd);
+ }
if ( *(char**)option[i].target != NULL )
gtk_text_buffer_set_text (textbuffer, *(char**)option[i].target, -1);
else
The font used for the clocks. If the option value is a pattern
that does not specify the font size, XBoard tries to choose an
appropriate font for the board size being used.
-Default: -*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*.
+Default Xaw: -*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*.
+Default GTK: Sans Bold %d.
@item -coordFont font
@cindex coordFont, option
@cindex Font, coordinates
is true. If the option value is a pattern that does not specify
the font size, XBoard tries to choose an appropriate font for
the board size being used.
-Default: -*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*.
+Default Xaw: -*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*.
+Default GTK: Sans Bold %d.
@item -messageFont font
@cindex messageFont, option
@cindex Font, message
-The font used for popup dialogs, menus, comments, etc.
+The font used for popup dialogs, menus, etc.
If the option value is a pattern that does not specify
the font size, XBoard tries to choose an appropriate font for
the board size being used.
-Default: -*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*.
+Default Xaw: -*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*.
+Default GTK: Sans Bold %d.
+@cindex tagsFont, option
+@cindex Font, tags
+The font used in the Edit Tags dialog.
+If the option value contains %d, XBoard will replace it by
+an appropriate font for the board size being used.
+(Only used in GTK build.)
+Default: Sans Normal %d.
+@cindex commentFont, option
+@cindex Font, comment
+The font used in the Edit Comment dialog.
+If the option value contains %d, XBoard will replace it by
+an appropriate font for the board size being used.
+(Only used in GTK build.)
+Default: Sans Normal %d.
+@cindex icsFont, option
+@cindex Font, ics
+The font used to display ICS output in the ICS Chat window.
+As ICS output often contains tables aligned by spaces,
+a mono-space font is recommended here.
+If the option value contains %d, XBoard will replace it by
+an appropriate font for the board size being used.
+(Only used in GTK build.)
+Default: Monospace Normal %d.
+@cindex moveHistoryFont, option
+@cindex Font, moveHistory
+The font used in Move History and Engine Output windows.
+As these windows display mainly moves,
+one could use a figurine font here.
+If the option value contains %d, XBoard will replace it by
+an appropriate font for the board size being used.
+(Only used in GTK build.)
+Default: Sans Normal %d.
+@cindex gameListFont, option
+@cindex Font, gameList
+The font used in the listbox of the Game List window.
+If the option value contains %d, XBoard will replace it by
+an appropriate font for the board size being used.
+(Only used in GTK build.)
+Default: Sans Bold %d.
@item -fontSizeTolerance tol
@cindex fontSizeTolerance, option
In the font selection algorithm, a nonscalable font will be preferred