diff --git a/auxi.c b/auxi.c index 020b2a7..a0a35b7 100644 --- a/auxi.c +++ b/auxi.c @@ -203,6 +203,7 @@ write_config_file (void) fprintf (file, "global_height=%" LLFORMAT "\n", prop.global_height); fprintf (file, "global_width=%" LLFORMAT "\n", prop.global_width); fprintf (file, "latex_export=%d\n", prop.latex_export); + fprintf (file, "serif=%d\n", prop.serif); if (prop.path_gs != NULL) fprintf (file, "path_gs=%s\n", prop.path_gs); if (prop.path_pstoedit != NULL) @@ -233,6 +234,8 @@ #define LEN 100 sscanf (buf, "global_width=%" LLFORMAT "\n", &(prop.global_width)); if (strncmp (buf, "latex_export=", 13) == 0) sscanf (buf, "latex_export=%d\n", &(prop.latex_export)); + if (strncmp (buf, "serif=", 6) == 0) + sscanf (buf, "serif=%d\n", &(prop.serif)); if (strncmp (buf, "path_gs=", 8) == 0) { /* We have to remove the newline at the end */ diff --git a/common.h b/common.h index 8044fcf..47e92ba 100644 --- a/common.h +++ b/common.h @@ -147,6 +147,7 @@ struct Properties LLINT global_height; LLINT global_width; int latex_export; + int serif; gchar * path_gs; gchar * path_pstoedit; }; diff --git a/easychem.c b/easychem.c index bf8f187..afdda86 100644 --- a/easychem.c +++ b/easychem.c @@ -100,7 +100,7 @@ GdkGC *gc_help, *gc_sel, *gc_gray; /* Here are the default properties, take care not to mess with that! */ -struct Properties prop = { GLOBAL_SIZE_H, GLOBAL_SIZE_V, TRUE, NULL, NULL }; +struct Properties prop = { GLOBAL_SIZE_H, GLOBAL_SIZE_V, TRUE, TRUE, NULL, NULL }; /* Some variables need to be static */ @@ -661,7 +661,7 @@ menu_export (void) { int response; unsigned int i; - GtkWidget *dialog, *label, *radio[EXPORT_DELIMITER], *latex; + GtkWidget *dialog, *label, *radio[EXPORT_DELIMITER], *latex, *serif; if (gs_status == PROGRAM_UNKNOWN) gs_status = detect_gs (); @@ -720,6 +720,14 @@ menu_export (void) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (latex), TRUE); else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (latex), FALSE); + + serif = gtk_check_button_new_with_label (_("Use serif fonts")); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), serif, + TRUE, TRUE, 20); + if (prop.serif) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (serif), TRUE); + else + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (serif), FALSE); gtk_widget_show_all (dialog); @@ -735,6 +743,8 @@ menu_export (void) export_type = i; prop.latex_export = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (latex)); + prop.serif = gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (serif)); gtk_widget_destroy (dialog); menu_export_file (); } diff --git a/export.c b/export.c index 531edf3..20362f7 100644 --- a/export.c +++ b/export.c @@ -1044,7 +1044,14 @@ #include "postscript/cm_common.c" } else { + if (prop.serif) + { #include "postscript/times.c" + } + else + { +#include "postscript/helvetica.c" + } } } diff --git a/postscript/Makefile b/postscript/Makefile index db1abae..88b4d4c 100644 --- a/postscript/Makefile +++ b/postscript/Makefile @@ -1,4 +1,4 @@ -all: preamble.c times.c cm.c cmi.c cmb.c cmbi.c cm_common.c +all: preamble.c helvetica.c times.c cm.c cmi.c cmb.c cmbi.c cm_common.c %.c: %.ps # sed -e 's#$$#\\n", file);#' $*.ps | sed -e 's#^#fputs ("#' > $*.c diff --git a/postscript/helvetica.ps b/postscript/helvetica.ps new file mode 100644 index 0000000..be2ac31 --- /dev/null +++ b/postscript/helvetica.ps @@ -0,0 +1,49 @@ +[/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/space/exclam/quotedbl/numbersign/dollar/percent/ampersand +/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period +/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon +/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I +/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft +/backslash/bracketright/asciicircum/underscore/quoteleft/a/b/c/d +/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z +/braceleft/bar/braceright/asciitilde/Euro/oe/OE +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space/exclamdown +/cent/sterling/currency/yen/brokenbar/section/dieresis/copyright +/ordfeminine/guillemotleft/logicalnot/hyphen/registered/macron +/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph +/periodcentered/cedilla/onesuperior/ordmasculine/guillemotright +/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute +/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute +/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis/Eth +/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply/Oslash +/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls +/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla +/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex +/idieresis/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis +/divide/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn +/ydieresis]/isolatin1encoding exch def + +% Makes the latin1 encoding for a given font +/latin1{findfont dup length dict begin{1 i /FID ne{def}{pop pop}ifelse}forall + /Encoding isolatin1encoding def currentdict end definefont pop}bd + +% The fonts we will probably use +/TR/Helvetica latin1 +/TRi/Helvetica-Oblique latin1 +/TRb/Helvetica-Bold latin1 +/TRbi/Helvetica-BoldOblique latin1 + +% This is used to set the font to the current fs/relfs/ft values +/sf{ft 0 eq{/TR findfont}{ft 1 eq{/TRi findfont}{ft 2 eq{/TRb findfont}{/TRbi + findfont}ifelse}ifelse}ifelse fs relfs mul scalefont setfont}bd +% This is used to set the font to Symbol, ignoring ft and using relfs/fs +/g{/Symbol findfont fs relfs mul scalefont setfont}bd + +% We set the font +sf