#define HEX_FORMAT 7
#define PSF_FORMAT 8
#define PSFUNI_FORMAT 9
+#define HEADER_FORMAT 10
/*
* An array of filters used for the open/import and save dialogs.
gtk_file_filter_add_pattern(filename_filters[PSF_FORMAT],
"*.[Ps][Ss][Ff]*");
+ filename_filters[HEADER_FORMAT] = gtk_file_filter_new();
+ gtk_file_filter_add_pattern(filename_filters[HEADER_FORMAT],
+ "*.[Hh]");
+
+
/*
* This one is basically for exporting unimap files that belong to PSF
* fonts.
case HEX_FORMAT:
bdf_export_hex(out, font, &options.font_opts, 0, 0);
break;
+ case HEADER_FORMAT:
+ bdf_export_header(out, font, &options.font_opts, 0, 0);
+ break;
case PSF_FORMAT:
sinfo.start = sinfo.end = 0;
(void) fontgrid_has_selection(FONTGRID(ed->fgrid), &sinfo);
case OTF_FORMAT: title = "TrueType"; break;
case PSF_FORMAT: title = "PSF"; break;
case HEX_FORMAT: title = "HEX"; break;
+ case HEADER_FORMAT: title = "HEADER"; break;
}
if (save) {
(void) strcpy(dot, ".psfu");
else if (type == HEX_FORMAT)
(void) strcpy(dot, ".hex");
+ else if (type == HEADER_FORMAT)
+ (void) strcpy(dot, ".h");
} else
dotpos = -1;
guiutil_show_dialog_centered(ed->save_dialog, ed->shell);
}
+void
+guifile_export_header_font(GtkWidget *w, gpointer data)
+{
+ gbdfed_editor_t *ed = editors + GPOINTER_TO_UINT(data);
+
+ /*
+ * No check is done for a "valid" HEX font because it actually pads the
+ * output font into bitmaps of two sizes, the wider size twice as wide
+ * as the narrower size.
+ */
+
+ update_save_dialog(ed, HEADER_FORMAT);
+
+ guiutil_show_dialog_centered(ed->save_dialog, ed->shell);
+}
+
void
guifile_save_as(GtkWidget *w, gpointer data)
{