X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fpostscript.c;h=919d1bb7debd31de3f6f5338fbbedc9db2c638c0;hb=5853c2fb0300e3db0ac6a06f1d91a7454f53be42;hp=43b19f2bfbe85f5e8fa0b5c987e9bb18fecd2a62;hpb=52b9fca3a729eaef7d13469029e4391aa033a659;p=pspp-builds.git diff --git a/src/output/postscript.c b/src/output/postscript.c index 43b19f2b..919d1bb7 100644 --- a/src/output/postscript.c +++ b/src/output/postscript.c @@ -35,7 +35,7 @@ #include #include -#include +#include #include "afm.h" #include "chart.h" @@ -424,16 +424,16 @@ handle_option (struct outp_driver *this, const char *key, } /* Looks for a PostScript font file or config file in all the - appropriate places. Returns the filename on success, NULL on + appropriate places. Returns the file name on success, NULL on failure. */ static char * find_ps_file (const char *name) { - if (fn_absolute_p (name)) + if (fn_is_absolute (name)) return xstrdup (name); else { - char *base_name = xasprintf ("psfonts%c%s", DIR_SEPARATOR, name); + char *base_name = xasprintf ("psfonts/%s", name); char *file_name = fn_search_path (base_name, config_path, NULL); free (base_name); return file_name; @@ -674,35 +674,35 @@ ps_line (struct outp_driver *this, enum outp_line_style top, enum outp_line_style left, enum outp_line_style bottom, enum outp_line_style right) { -/* The algorithm here is somewhat subtle, to allow it to handle - all the kinds of intersections that we need. - - Three additional ordinates are assigned along the x axis. The - first is xc, midway between x0 and x3. The others are x1 and - x2; for a single vertical line these are equal to xc, and for - a double vertical line they are the ordinates of the left and - right half of the double line. - - yc, y1, and y2 are assigned similarly along the y axis. - - The following diagram shows the coordinate system and output - for double top and bottom lines, single left line, and no - right line: - - x0 x1 xc x2 x3 - y0 ________________________ - | # # | - | # # | - | # # | - | # # | - | # # | - y1 = y2 = yc |######### # | - | # # | - | # # | - | # # | - | # # | - y3 |________#_____#_______| -*/ + /* The algorithm here is somewhat subtle, to allow it to handle + all the kinds of intersections that we need. + + Three additional ordinates are assigned along the x axis. The + first is xc, midway between x0 and x3. The others are x1 and + x2; for a single vertical line these are equal to xc, and for + a double vertical line they are the ordinates of the left and + right half of the double line. + + yc, y1, and y2 are assigned similarly along the y axis. + + The following diagram shows the coordinate system and output + for double top and bottom lines, single left line, and no + right line: + + x0 x1 xc x2 x3 + y0 ________________________ + | # # | + | # # | + | # # | + | # # | + | # # | + y1 = y2 = yc |######### # | + | # # | + | # # | + | # # | + | # # | + y3 |________#_____#_______| + */ struct ps_driver_ext *ext = this->ext; /* Offset from center of each line in a pair of double lines. */ @@ -874,7 +874,7 @@ write_text (struct outp_driver *this, fprintf (ext->file, "F%d setfont\n", font); } - ds_init (&out, 0); + ds_init (&out); for (i = 0; i < char_cnt; i = j) { for (j = i + 1; j < char_cnt; j++) @@ -1145,7 +1145,7 @@ ps_chart_finalise (struct outp_driver *this UNUSED, struct chart *ch UNUSED) continue; fclose (ch->file); - fputs ("%%%%EndDocument\n" + fputs ("%%EndDocument\n" "end\n" "sp restore\n", x->file); @@ -1382,7 +1382,7 @@ reencode_font (struct outp_driver *this, struct font *font) line_number = 0; - ds_init (&line, 0); + ds_init (&line); while (ds_get_config_line (file, &line, &line_number)) { char *pschar, *code;