+ /*
+ * In GTK1-only PuTTY, we used to store font names simply as a
+ * valid X font description string (logical or alias), under a
+ * bare key such as "Font".
+ *
+ * In GTK2 PuTTY, we have a prefix system where "client:"
+ * indicates a Pango font and "server:" an X one; existing
+ * configuration needs to be reinterpreted as having the
+ * "server:" prefix, so we change the storage key from the
+ * provided name string (e.g. "Font") to a suffixed one
+ * ("FontName").
+ */
+ char *suffname = dupcat(name, "Name", NULL);
+ char *tmp;
+
+ if ((tmp = read_setting_s(handle, suffname)) != NULL) {
+ strncpy(result->name, tmp, sizeof(result->name)-1);
+ result->name[sizeof(result->name)-1] = '\0';
+ sfree(suffname);
+ sfree(tmp);
+ return TRUE; /* got new-style name */
+ }
+ sfree(suffname);
+
+ /* Fall back to old-style name. */
+ tmp = read_setting_s(handle, name);
+ if (tmp && *tmp) {
+ strcpy(result->name, "server:");
+ strncpy(result->name + 7, tmp, sizeof(result->name) - 8);
+ result->name[sizeof(result->name)-1] = '\0';
+ sfree(tmp);
+ return TRUE;
+ } else {
+ sfree(tmp);
+ return FALSE;
+ }