argv@island.uu.net (Dan Heller) (07/21/89)
Submitted-by: Mark Moraes <moraes@ai.toronto.edu> Posting-number: Volume 4, Issue 71 Archive-name: xpic/part06 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 6 (of 15)." # Contents: xpic/newfonts.c xpic/test/marcel1.ps xpic/test/test.ps # xpic/test/test.ps.land xpic/xsimple.c # Wrapped by moraes@neat.ai on Thu Jul 13 22:36:08 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'xpic/newfonts.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xpic/newfonts.c'\" else echo shar: Extracting \"'xpic/newfonts.c'\" \(8983 characters\) sed "s/^X//" >'xpic/newfonts.c' <<'END_OF_FILE' X#ifndef lint Xstatic char *rcsid = "$Header: newfonts.c,v 1.5 89/04/30 16:28:29 xwindows Exp $"; X#endif X/* X * This reads in a font map, which describes what xpic font names (the X * ones shown on the buttons) map onto which X font names. It X * XListFonts() the server to get that information, and uses fonts of X * different scales by recomputing their effective point size on the X * screen given the screen resolution. It prepares tables of these and X * will step through the appropriate table for the +/- buttons. X */ X#include <ctype.h> X#include "xpic.h" X#include "windows.h" X#include "tune.h" X#include "assert.h" X#include "newfonts.h" X XXFontStruct *defaultFont; X Xstatic FontFamily *availFonts; Xstatic int nAvailFonts; Xstatic int maxAvailFonts; X Xstatic char *defaultFontName = NULL; Xstatic int defaultFontSize = 0; X X#define MAX_XFONTS 1024 X#define LINESIZE 128 X#define MAXFILENAME 256 X/* We allocate the availFonts array in chunks of FAMILY_CHUNK */ X#define FAMILY_CHUNK 16 /* !! */ X/* We allocate the availFonts[i].sizes array in chunks of SIZE_CHUNK */ X#define SIZE_CHUNK 32 /* !! */ X Xvoid readfontfile(filename) Xchar *filename; X{ X FILE *fp; X char line[LINESIZE]; X char pattern[LINESIZE]; X char fullname[MAXSTR]; X char prefix[MAXSTR]; X char basicname[MAXSTR]; X int default_dpi; X int dpi; X char **fontnames; X char **cp; X int fontsize; X int skip; X int nf; X int i; X FontFamily *fptr, *findfont(); X void addfont(); X X#define parse_error() \ X (void) fprintf(stderr, "xpic: Bad line in fontdesc file %s\n\t%s\n", \ X filename, line) \ X X if ((fp = fopen(filename, "r")) == NULL) X return; X while(fgets(line, LINESIZE, fp) != NULL) { X if (sscanf(line, " %s", fullname) != 1) { X parse_error(); X continue; X } else if (strcmp(fullname, "default") == 0) { X if (sscanf(line, " %*s %s %d", fullname, &defaultFontSize) != 2) { X parse_error(); X } else { X defaultFontName = strcpy(XtMalloc((unsigned) X (strlen(fullname) + 1)), fullname); X } X continue; X } X /* else */ X i = sscanf(line, " %s %s %s %d", fullname, prefix, basicname, &default_dpi); X if (i < 3 || i > 4) { X parse_error(); X continue; X } else if (i == 3) { X if (strcmp(prefix,"devsun") == NULL) X default_dpi = 120; X else X default_dpi = 75; X } X (void) sprintf(pattern, "%s.%s.*", prefix, basicname); X fontnames = XListFonts(picDpy, pattern, MAX_XFONTS, &nf); X if (nf == 0) { X#ifdef DEBUG X (void) fprintf(stderr, "Warning: No fonts found for %s\n",pattern); X#endif X continue; X } X fptr = findfont(fullname, FALSE); X skip = strlen(prefix) + 1 + strlen(basicname) + 1; X ASSERT(allock(), "start"); X cp = fontnames; X while(--nf >= 0) { X char *tmp; X fontsize = atoi(*cp + skip); X if (fontsize == 0) { X free(*cp); X *cp = NULL; X cp++; X continue; X } X for(tmp = *cp + skip; *tmp != '\0' && isdigit(*tmp); X tmp++) X ; X /* X * Extract fontsize in font name X */ X if (*tmp == '\0') /* devpsc.r.24 */ X dpi = default_dpi; X else if (*tmp == '.') /* devpsc.r.24.75 */ X dpi = atoi(++tmp); X else X dpi = 0; X if (dpi == 0) { X free(*cp); X *cp = NULL; X cp++; X continue; X } X addfont(fptr, *cp, fontsize, dpi); X ASSERT(allock(), "end"); X cp++; X } X } X} X X X/* X * Finds the entry for font family - makes a new one if necessary. X * Straight linear search for now. X */ XFontFamily *findfont(fullname, return_null) Xchar *fullname; X{ X register FontFamily *fptr; X register int i; X char *name = XtMalloc((unsigned) (strlen(fullname) + 1)); X X (void) strcpy(name, fullname); X for (i = 0, fptr = availFonts; i < nAvailFonts; i++, fptr++) X if(STREQ(name, fptr->name)) X break; X if (i == nAvailFonts && !return_null) { X /* Make sure there's enough space */ X if (nAvailFonts == maxAvailFonts) { X /* No - we need to grow the table */ X maxAvailFonts += FAMILY_CHUNK; X availFonts = (FontFamily *) XtRealloc((char *) availFonts, X (unsigned) (maxAvailFonts * sizeof(FontFamily))); X#ifdef DEBUG X printf("realloced font families' table to %d\n", maxAvailFonts); X#endif X for (i = nAvailFonts; i < maxAvailFonts; i++) { X availFonts[i].nsizes = 0; X availFonts[i].maxsizes = SIZE_CHUNK; X availFonts[i].sizes = (FontSizes *)XtCalloc(sizeof(FontSizes), X SIZE_CHUNK); X availFonts[i].name = NULL; X availFonts[i].cursize = 0; X } X /* X * Make sure fptr points to realloc'ed table to same place X * it pointed to in old table. X */ X fptr = availFonts + nAvailFonts; X } X /* Isn't there yet, so add it */ X fptr->name = name; X nAvailFonts++; X#ifdef DEBUG X printf("Added font family %s\n", name); X#endif X } else if (i == nAvailFonts && return_null) { X return(NULL); X } X return(fptr); X} X X Xstatic void addfont(fptr, fontname, fontsize, dpi) XFontFamily *fptr; Xchar *fontname; X{ X int realsize = (8. * dpi * fontsize)/(75. * gridSpacing) + .5; X#if 0 X /* X * This is the exact font calculation - the above fudge gives better X * results since the fonts are 75 dpi and the xpic grid is 80 dpi. So X * we just fake it to pretend both are the same X */ X int realsize = (dpi * fontsize)/(10. * gridSpacing) + .5; X#endif X register int i; X register FontSizes *sptr; X register FontSizes *sp; X X /* X * Find the place for inserting the fontname by pointsize - the X * table is ordered by pointsize X */ X for(i = 0; i < fptr->nsizes && fptr->sizes[i].pointsize < realsize; i++) X ; X if (i < fptr->nsizes && fptr->sizes[i].pointsize == realsize) { X /* Duplicate - ignore */ X#ifdef DEBUG X printf("duplicate - %s and %s are both %d in size in family %s\n", X fptr->sizes[i].xfontname, fontname, realsize, fptr->name); X#endif DEBUG X return; X } X /* Reallocate if we're overrunning */ X if (fptr->nsizes == fptr->maxsizes) { X fptr->maxsizes += SIZE_CHUNK; X fptr->sizes = (FontSizes *) XtRealloc((char *) fptr->sizes, X (unsigned) (fptr->maxsizes * sizeof(FontSizes))); X#ifdef DEBUG X printf("reallocing sizes for family %s to %d\n", fptr->name, X fptr->maxsizes); X#endif X } X sptr = &fptr->sizes[i]; X /* Now insert the FontSize info */ X if (sptr->pointsize == 0) { X /* add at the end */ X sptr->pointsize = realsize; X sptr->xfontname = fontname; X sptr->font = NULL; X} else { X sp = fptr->sizes + fptr->nsizes; X bcopy((char *)sptr, (char *)(sptr+1), (sp - sptr)*sizeof(FontSizes)); X sptr->pointsize = realsize; X sptr->xfontname = fontname; X sptr->font = NULL; X } X fptr->nsizes++; X#ifdef DEBUG X printf("added %s - pointsize %d to family %s\n", fontname, realsize, X fptr->name); X#endif X} X X/* X * Changes the font, and opens the new font if it hasn't been used yet. X * On error, if a font can't be opened, it doesn't change the font. X * Internally, the font changed because the button was X * updated, the real font size and name will be stored with the Gel X */ XXFontStruct *ChangeFont(fontsize, pad) XFontSizes *fontsize; Xint *pad; X{ X XFontStruct *textfont; X X *pad = 0; X X if (fontsize->font == NULL) { X if ((fontsize->font = XLoadQueryFont(picDpy, fontsize->xfontname)) X == NULL) { X (void) sprintf(errstring, "Can't find font %s", X fontsize->xfontname); X message(errstring); X /* So we don't go thru this again... */ X fontsize->font = defaultFont; X } X } X textfont = fontsize->font; X X /* X * Compute the new width of the space character - It is assumed that X * the space character does not exist in the fonts we are using, i.e. X * it is zero width. This is true of vfonts, and of some of the X X * proportional width fonts. The space width is taken to be the Troff X * width of 12/36 ems. X */ X *pad = XTextWidth(textfont, " ", 1); X if (*pad == 0) X *pad = XTextWidth(textfont, "m", 1) / 3; X X return(textfont); X} X X/* finds the index of the closest pointsize in FontFamily fptr. */ Xint findsize(fptr, realsize) XFontFamily *fptr; Xint realsize; X{ X register int i; X X /* find pointsize */ X for(i = 0; i < fptr->nsizes && fptr->sizes[i].pointsize < realsize; i++) X ; X if (i >= fptr->nsizes) X /* largest size available */ X i = fptr->nsizes - 1; X return(i); X X} X X XFontFamily *InitFonts(default_fontname, default_fontsize, n_availfonts) Xchar **default_fontname; Xint *default_fontsize; Xint *n_availfonts; X{ X register int i; X char filename[MAXFILENAME]; X X maxAvailFonts = FAMILY_CHUNK; X nAvailFonts = 0; X availFonts = (FontFamily *) XtCalloc(sizeof(FontFamily), FAMILY_CHUNK); X for (i = 0; i < FAMILY_CHUNK; i++) { X availFonts[i].nsizes = 0; X availFonts[i].maxsizes = SIZE_CHUNK; X availFonts[i].sizes = (FontSizes *) XtCalloc(sizeof(FontSizes), X SIZE_CHUNK); X availFonts[i].name = NULL; X } X X (void) sprintf(filename, "%s/fontdesc/xpic", LIBDIR); X readfontfile(filename); X (void) sprintf(filename, "%s/.xpic", homeDir); X readfontfile(filename); X *default_fontname = defaultFontName; X *default_fontsize = defaultFontSize; X *n_availfonts = nAvailFonts; X return(availFonts); X} X X#ifdef TEST Xmain(argc, argv) Xchar **argv; X{ X Widget toplevel = XtInitialize("testfont", "TestFont", NULL, 0, X &argc, argv); X X picDpy = XtDisplay(toplevel); X X InitFonts(); X} X XDying() X{ X abort(); X} X#endif END_OF_FILE if test 8983 -ne `wc -c <'xpic/newfonts.c'`; then echo shar: \"'xpic/newfonts.c'\" unpacked with wrong size! fi # end of 'xpic/newfonts.c' fi if test -f 'xpic/test/marcel1.ps' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xpic/test/marcel1.ps'\" else echo shar: Extracting \"'xpic/test/marcel1.ps'\" \(9039 characters\) sed "s/^X//" >'xpic/test/marcel1.ps' <<'END_OF_FILE' X%! X%%Creator: root@bay.csri (Operator) X%%Title: marcel.xpic (xpic) X%%CreationDate: Wed May 4 23:55:30 1988 X%%Pages: 1 X%%DocumentFonts: (atend) X%%BoundingBox: 212.94 28.62 612 348.3 X% (in inches) at 2.9575 0.3975, width 5.5425, height 4.44 X%%EndComments X% Prolog for xpic to PostScript converter X% Author: Mark Moraes X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp X% %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH X% %d F - change font ROMAN, BOLD, ITALIC, SPECIAL X% %d S - change size (font size in points) X% (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE) X% (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE) X% (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE) X% %d %d l - lineto X% %d %d m - moveto X% %d %d s - spline segment X% x - flush line, spline X% <wid> <ht> <x> <y> b - box X% <wid> <ht> <x> <y> e - ellipse X% %d ss - setscale X% %d W - change linewidth Xsave 50 dict begin /xpic exch def X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def X% Set defaults X/fontname /Times-Roman def X/ptsize 12 def X% xpic has 4 fonts R, B, I, S X/nfonts 4 def X/fonts /Times-Roman /Times-Bold /Times-Italic /Symbol nfonts array astore def X% halign has the values for MIDLINE, TOPLINE, BOTLINE X/halign 3 array def X/s {rcurveto} def X/x {stroke} def X/l {lineto} def X/m {moveto} def X/b { X /ury exch def /urx exch def /lly exch def /llx exch def X llx lly moveto urx lly lineto urx ury lineto X llx ury lineto llx lly lineto stroke X} def X/mtrx matrix def X/e { X /yc exch def /xc exch def /yrad exch def /xrad exch def X xc xrad add yc moveto X /savematrix mtrx currentmatrix def X xc yc translate X xrad yrad scale X 0 0 1 0 360 arc X savematrix setmatrix stroke X} def X% The next three take the text string, and moveto the right horiz. position X% leaving the string on the stack. X/lj {} def X/rj {dup stringwidth pop neg 0 rmoveto} def X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def X% And this is invoked after one of the three above, and X% computes the vert. pos, and then displays the string. X/t {halign exch get 0 exch rmoveto show newpath} def X% Store an array of patterns in /styles - a pattern is an array consisting X% of an array and an offset. Corresp to xpic patterns X% solid, dotted, short-dashed, long-dashed, dot-dashed X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ] X 5 array astore def X% change style to arg. X/D {stroke styles exch get aload pop setdash newpath} def X/W {stroke setlinewidth newpath} def X% fontbox takes a fontname of the stack, and returns an array X% containing the values of the bottom line of the bounding box, the X% mid line of the bounding box, and the top line of the bounding box X% of that font, taken from the baseline, scaled to a font of size 1 X/fontbox { X findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop X /ytop exch def pop /ybot exch def pop X /ymid ytop ybot sub 2 div def X 0 ybot fm dtransform exch pop % botline X dup neg exch % midline - this works better than (ytop-ybot)/2! X 0 ytop fm dtransform exch pop exch %topline X % now in the order midline, topline, botline. X 3 array astore X} def X% fontboxes stores the fontbox of each of the fontnames in the 'fonts' X% array X/fontboxes nfonts array def X0 1 nfonts 1 sub { X fontboxes exch dup fonts exch get fontbox put X} for X% select font X/F { X dup fonts exch get /fontname exch def fontboxes exch get X /thisfontbox exch def SF X} def X% set point size X/S {/ptsize exch def SF} def X% actually set font X/SF { X fontname findfont ptsize curscale div scalefont setfont X thisfontbox aload pop X 1 1 3 { X pop ptsize mul curscale div neg 3 1 roll X } for X halign astore pop X} def X% sets the scale to 72 / n, where n is on the stack, and stores the value X% in curscale for font scaling X/curscale 1 def X/ss {/curscale exch 72 exch div dup dup scale def} def X/land {8.5 72 mul curscale div 0 translate 90 rotate} def XStartXpic X%%EndProlog Xland X0.6 0.6 scale X80 ss X0 F X12 S X215 501 m X(uCode) ce 0 t X1 F X39 677 m X(IFU) lj 0 t X0 F X215 525 m X(IDU) ce 0 t X151 509 m X(EU uCode) ce 0 t X151 509 m X() ce 0 t X175 541 m X(uROM) ce 0 t X0 D X191 477 m X191 533 l Xx X359 301 m X(\(2-port\)) ce 0 t X359 325 m X(Register File) ce 0 t X359 341 m X(BASE) ce 0 t X10 S X231 325 m X(Increment) ce 0 t X463 325 m X(Increment) ce 0 t X463 341 m X(SP) ce 0 t X231 341 m X(PC) ce 0 t X215 429 m X(Check) ce 0 t X215 445 m X(Stall) ce 0 t X191 453 239 421 b X8 S X151 101 m X(Decoded Instr 3) ce 0 t X151 221 m X(Decoded Instr 2) ce 0 t X103 109 199 93 b X151 253 m X231 253 l X0 D X223 257 m X231 253 l X223 250 l X0 D X231 253 m Xx X151 181 m X231 181 l X0 D X223 185 m X231 181 l X223 178 l X0 D X231 181 m Xx X103 229 199 213 b X103 397 199 381 b X10 S X471 389 m X(sop) ce 0 t X8 S X151 389 m X(Decoded Instruction) ce 0 t X10 S X383 389 m X(field 2) ce 0 t X295 389 m X(field 1) ce 0 t X311 589 m X(Decode Buffer) ce 0 t X375 653 m X(Instruction Queue \(7x18 bits\)) ce 0 t X271 669 487 637 b X335 709 m X(PC Stack \(16x30 bits\)) ce 0 t X271 725 399 693 b X18 S X151 693 m X(IFU) lj 0 t X127 661 m X(Controller) lj 0 t X407 461 m X(\(ODL\)) lj 0 t X327 461 m X(Logic) lj 0 t X327 493 m X(Decode) lj 0 t X327 525 m X(Operand) lj 0 t X287 149 m X(Logic) lj 0 t X327 581 m X327 557 l X0 D X331 566 m X327 557 l X324 566 l X0 D X327 557 m Xx X287 181 m X(Unit) lj 0 t X287 213 m X(Execution) lj 0 t X12 S X575 77 m X(\(2-port\)) ce 0 t X575 109 m X(Cache) ce 0 t X575 133 m X(Stack) ce 0 t X599 341 m X(BUS) ce 0 t X599 309 m X(Interface) ce 0 t X247 765 m X447 765 l Xx X1 F X20 S X343 781 m X(SLIME Architecture) ce 0 t X12 S X39 517 m X(IDU) lj 0 t X39 85 m X(EU 3) lj 0 t X39 181 m X(EU 2) lj 0 t X39 325 m X(EU 1) lj 0 t X423 317 m X407 317 l X0 D X416 314 m X407 317 l X416 321 l X0 D X407 317 m Xx X295 317 m X311 317 l X0 D X303 321 m X311 317 l X303 314 l X0 D X311 317 m Xx X255 437 m X239 437 l X0 D X248 434 m X239 437 l X248 441 l X0 D X239 437 m Xx X327 637 m X327 597 l X0 D X331 606 m X327 597 l X324 606 l X0 D X327 597 m Xx X295 637 m X295 597 l X0 D X299 606 m X295 597 l X292 606 l X0 D X295 597 m Xx X207 477 m X207 469 l X271 469 l X0 D X263 473 m X271 469 l X263 466 l X0 D X271 469 m Xx X295 381 m X295 269 l X0 D X299 278 m X295 269 l X292 278 l X0 D X295 269 m Xx X471 437 m X471 397 l X0 D X475 406 m X471 397 l X468 406 l X0 D X471 397 m Xx X391 437 m X391 397 l X0 D X395 406 m X391 397 l X388 406 l X0 D X391 397 m Xx X295 437 m X295 397 l X0 D X299 406 m X295 397 l X292 406 l X0 D X295 397 m Xx X295 573 m X263 573 l X263 517 l X231 517 l X0 D X240 514 m X231 517 l X240 521 l X0 D X231 517 m Xx X295 581 m X295 557 l X0 D X299 566 m X295 557 l X292 566 l X0 D X295 557 m Xx X471 117 m X0 D X480 114 m X471 117 l X480 121 l X0 D X471 117 m X527 117 l X0 D X519 121 m X527 117 l X519 114 l X0 D X527 117 m Xx X471 133 m X0 D X480 130 m X471 133 l X480 137 l X0 D X471 133 m X527 133 l X0 D X519 137 m X527 133 l X519 130 l X0 D X527 133 m Xx X263 333 m X0 D X272 330 m X263 333 l X272 337 l X0 D X263 333 m X311 333 l X0 D X303 337 m X311 333 l X303 330 l X0 D X311 333 m Xx X151 333 m X207 333 l X0 D X199 337 m X207 333 l X199 330 l X0 D X207 333 m Xx X255 349 m X255 613 l X191 613 l X191 637 l X0 D X188 629 m X191 637 l X195 629 l X0 D X191 637 m Xx X239 445 m X247 445 l X247 605 l X183 605 l X183 637 l X0 D X180 629 m X183 637 l X187 629 l X0 D X183 637 m Xx X207 349 263 309 b X151 477 m X151 397 l X0 D X155 406 m X151 397 l X148 406 l X0 D X151 397 m Xx X151 93 m X151 85 l X231 85 l X0 D X223 89 m X231 85 l X223 82 l X0 D X231 85 m Xx X151 213 m X151 109 l X0 D X155 118 m X151 109 l X148 118 l X0 D X151 109 m Xx X151 381 m X151 229 l X0 D X155 238 m X151 229 l X148 238 l X0 D X151 229 m Xx X471 381 m X471 349 l X0 D X475 358 m X471 349 l X468 358 l X0 D X471 349 m Xx X423 381 m X423 269 l X0 D X427 278 m X423 269 l X420 278 l X0 D X423 269 m Xx X487 653 m X543 653 l X543 277 l X0 D X547 286 m X543 277 l X540 286 l X0 D X543 277 m Xx X543 277 m X0 D X552 274 m X543 277 l X552 281 l X0 D X543 277 m X567 277 l X0 D X559 281 m X567 277 l X559 274 l X0 D X567 277 m Xx X543 157 m X0 D X547 166 m X543 157 l X540 166 l X0 D X543 157 m X543 277 l X0 D X540 269 m X543 277 l X547 269 l X0 D X543 277 m Xx X471 213 m X0 D X480 210 m X471 213 l X480 217 l X0 D X471 213 m X543 213 l X0 D X535 217 m X543 213 l X535 210 l X0 D X543 213 m Xx X407 333 m X0 D X416 330 m X407 333 l X416 337 l X0 D X407 333 m X439 333 l X0 D X431 337 m X439 333 l X431 330 l X0 D X439 333 m Xx X383 293 m X0 D X380 285 m X383 293 l X387 285 l X0 D X383 293 m X383 269 l X0 D X387 278 m X383 269 l X380 278 l X0 D X383 269 m Xx X335 293 m X0 D X332 285 m X335 293 l X339 285 l X0 D X335 293 m X335 269 l X0 D X339 278 m X335 269 l X332 278 l X0 D X335 269 m Xx X231 661 m X0 D X240 658 m X231 661 l X240 665 l X0 D X231 661 m X271 661 l X0 D X263 665 m X271 661 l X263 658 l X0 D X271 661 m Xx X231 709 m X0 D X240 706 m X231 709 l X240 713 l X0 D X231 709 m X271 709 l X0 D X263 713 m X271 709 l X263 706 l X0 D X271 709 m Xx X567 373 631 205 b X527 157 623 53 b X111 717 231 637 b X271 597 351 581 b X271 557 487 437 b X111 557 231 477 b X271 397 319 381 b X343 397 431 381 b X455 397 487 381 b X311 357 407 293 b X439 349 495 309 b X231 269 471 77 b X1 D X87 741 511 53 b X87 613 m X511 613 l Xx X87 413 m X511 413 l Xx X2 D X87 245 m X511 245 l Xx X87 125 m X511 125 l Xx X%%Trailer Xshowpage X% Trailer for xpic to PostScript converter X% $Header: x2ps.tra,v 1.1 87/11/21 20:33:03 moraes Exp $ Xxpic end restore X%%DocumentFonts: Times-Roman Times-Italic Times-Bold Special END_OF_FILE if test 9039 -ne `wc -c <'xpic/test/marcel1.ps'`; then echo shar: \"'xpic/test/marcel1.ps'\" unpacked with wrong size! fi # end of 'xpic/test/marcel1.ps' fi if test -f 'xpic/test/test.ps' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xpic/test/test.ps'\" else echo shar: Extracting \"'xpic/test/test.ps'\" \(8911 characters\) sed "s/^X//" >'xpic/test/test.ps' <<'END_OF_FILE' X%! X%%Creator: root@bay.csri (Operator) X%%Title: test.xpic (xpic) X%%CreationDate: Wed May 4 23:50:40 1988 X%%Pages: 1 X%%DocumentFonts: (atend) X%%BoundingBox: 7.2 28.8 561.6 748.8 X% (in inches) at 0.1 0.4, width 7.7, height 10 X%%EndComments X% Prolog for xpic to PostScript converter X% Author: Mark Moraes X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp X% %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH X% %d F - change font ROMAN, BOLD, ITALIC, SPECIAL X% %d S - change size (font size in points) X% (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE) X% (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE) X% (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE) X% %d %d l - lineto X% %d %d m - moveto X% %d %d s - spline segment X% x - flush line, spline X% <wid> <ht> <x> <y> b - box X% <wid> <ht> <x> <y> e - ellipse X% %d ss - setscale X% %d W - change linewidth Xsave 50 dict begin /xpic exch def X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def X% Set defaults X/fontname /Times-Roman def X/ptsize 12 def X% xpic has 4 fonts R, B, I, S X/nfonts 4 def X/fonts /Times-Roman /Times-Bold /Times-Italic /Symbol nfonts array astore def X% halign has the values for MIDLINE, TOPLINE, BOTLINE X/halign 3 array def X/s {rcurveto} def X/x {stroke} def X/l {lineto} def X/m {moveto} def X/b { X /ury exch def /urx exch def /lly exch def /llx exch def X llx lly moveto urx lly lineto urx ury lineto X llx ury lineto llx lly lineto stroke X} def X/mtrx matrix def X/e { X /yc exch def /xc exch def /yrad exch def /xrad exch def X xc xrad add yc moveto X /savematrix mtrx currentmatrix def X xc yc translate X xrad yrad scale X 0 0 1 0 360 arc X savematrix setmatrix stroke X} def X% The next three take the text string, and moveto the right horiz. position X% leaving the string on the stack. X/lj {} def X/rj {dup stringwidth pop neg 0 rmoveto} def X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def X% And this is invoked after one of the three above, and X% computes the vert. pos, and then displays the string. X/t {halign exch get 0 exch rmoveto show newpath} def X% Store an array of patterns in /styles - a pattern is an array consisting X% of an array and an offset. Corresp to xpic patterns X% solid, dotted, short-dashed, long-dashed, dot-dashed X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ] X 5 array astore def X% change style to arg. X/D {stroke styles exch get aload pop setdash newpath} def X/W {stroke setlinewidth newpath} def X% fontbox takes a fontname of the stack, and returns an array X% containing the values of the bottom line of the bounding box, the X% mid line of the bounding box, and the top line of the bounding box X% of that font, taken from the baseline, scaled to a font of size 1 X/fontbox { X findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop X /ytop exch def pop /ybot exch def pop X /ymid ytop ybot sub 2 div def X 0 ybot fm dtransform exch pop % botline X dup neg exch % midline - this works better than (ytop-ybot)/2! X 0 ytop fm dtransform exch pop exch %topline X % now in the order midline, topline, botline. X 3 array astore X} def X% fontboxes stores the fontbox of each of the fontnames in the 'fonts' X% array X/fontboxes nfonts array def X0 1 nfonts 1 sub { X fontboxes exch dup fonts exch get fontbox put X} for X% select font X/F { X dup fonts exch get /fontname exch def fontboxes exch get X /thisfontbox exch def SF X} def X% set point size X/S {/ptsize exch def SF} def X% actually set font X/SF { X fontname findfont ptsize curscale div scalefont setfont X thisfontbox aload pop X 1 1 3 { X pop ptsize mul curscale div neg 3 1 roll X } for X halign astore pop X} def X% sets the scale to 72 / n, where n is on the stack, and stores the value X% in curscale for font scaling X/curscale 1 def X/ss {/curscale exch 72 exch div dup dup scale def} def X/land {8.5 72 mul curscale div 0 translate 90 rotate} def XStartXpic X%%EndProlog X1 1 scale X80 ss X0 F X20 S X487 336 m X(hello world) lj 2 t X1 F X24 S X247 368 m X(xxxxxx) lj 2 t X2 D X16 28 439 396 e X0 F X12 S X439 320 m X(lj top \(moved\)) lj 1 t X3 D X68 8 563 424 e X4 D X56 20 95 372 e X1 D X44 16 571 472 e X0 D X48 20 471 468 e X1 F X191 344 m X(hello world) ce 0 t X3 F X191 320 m X(hello world) ce 0 t X4 D X151 328 231 312 b X159 352 223 336 b X159 376 223 360 b X0 F X359 320 m X(bottom center) ce 2 t X359 360 m X(top center) ce 1 t X3 D X215 584 m X295 584 l X215 504 l X295 504 l X0 D X287 508 m X295 504 l X287 501 l X3 D X295 504 m Xx X4 D X415 584 m X0 D X415 575 m X415 584 l X423 579 l X4 D X415 584 m X455 504 l X455 584 l X495 504 l X495 544 l X0 D X492 536 m X495 544 l X499 536 l X4 D X495 544 m Xx X519 504 m X0 D X523 513 m X519 504 l X516 513 l X4 D X519 504 m X519 584 l X551 504 l X551 584 l Xx X575 504 m X575 584 l X615 504 l X615 584 l X583 496 l X0 D X590 503 m X583 496 l X583 506 l X4 D X583 496 m Xx X1 D X455 264 m X0 D X464 262 m X455 264 l X463 270 l X1 D X455 264 m X0 0 10 1 32 4 s X21 2 25 -8 12 -32 s X-13 -24 -20 -29 -20 -16 s X0 13 8 20 24 20 s X16 0 26 -2 32 -8 s X5 -5 -2 -20 -24 -44 s X-21 -24 -53 -36 -96 -36 s X0 D X424 149 m X415 152 l X424 156 l X1 D X415 152 m Xx X4 D X231 152 m X0 D X241 151 m X231 152 l X239 158 l X4 D X231 152 m X0 0 12 2 36 8 s X24 5 32 -4 24 -28 s X-8 -24 -17 -34 -28 -32 s X-10 2 -16 6 -16 12 s X0 5 14 4 44 -4 s X29 -8 45 -17 48 -28 s X2 -10 -10 -21 -40 -32 s X-29 -10 -50 -10 -64 0 s X-13 10 -20 17 -20 20 s X0 2 2 4 8 4 s X5 0 14 -2 28 -8 s X13 -5 33 13 60 56 s X0 D X303 116 m X311 120 l X311 111 l X4 D X311 120 m Xx X3 D X55 136 m X0 D X65 136 m X55 136 l X62 143 l X3 D X55 136 m X0 0 8 2 24 8 s X16 5 24 -5 24 -32 s X0 -26 -9 -37 -28 -32 s X-18 5 -28 9 -28 12 s X0 2 9 4 28 4 s X18 0 45 4 80 12 s X34 8 48 16 40 24 s X-8 8 -18 8 -32 0 s X-13 -8 -9 -30 12 -68 s X0 D X175 74 m X175 64 l X168 70 l X3 D X175 64 m Xx X2 D X535 288 m X0 D X545 287 m X535 288 l X543 294 l X2 D X535 288 m X0 0 5 1 16 4 s X10 2 16 -1 16 -12 s X0 -10 1 -16 4 -16 s X2 0 8 1 16 4 s X8 2 14 8 20 16 s X5 8 9 1 12 -20 s X2 -21 2 -34 0 -40 s X-2 -5 -8 -8 -16 -8 s X-8 0 -12 2 -12 8 s X0 5 -5 4 -16 -4 s X-10 -8 -16 -14 -16 -20 s X0 -5 13 -8 40 -8 s X0 D X591 196 m X599 192 l X591 189 l X2 D X599 192 m Xx X0 D X351 288 m X0 D X360 285 m X351 288 l X360 292 l X0 D X351 288 m X0 0 10 0 32 0 s X21 0 26 -6 16 -20 s X-10 -13 -12 -21 -4 -24 s X8 -2 20 -4 36 -4 s X16 0 13 -8 -8 -24 s X-21 -16 -40 -24 -56 -24 s X0 D X376 189 m X367 192 l X376 196 l X0 D X367 192 m Xx X223 288 m X0 D X232 285 m X223 288 l X232 292 l X0 D X223 288 m X0 0 12 0 36 0 s X24 0 38 -8 44 -24 s X5 -16 -1 -26 -20 -32 s X-18 -5 -28 -4 -28 4 s X0 8 9 9 28 4 s X18 -5 34 -10 48 -16 s X13 -5 21 0 24 16 s X2 16 1 26 -4 32 s X-5 5 -16 -2 -32 -24 s X-16 -21 -25 -36 -28 -44 s X-2 -8 -14 -12 -36 -12 s Xx X79 272 m X0 0 -8 -5 -24 -16 s X-16 -10 -10 -14 16 -12 s X26 2 50 6 72 12 s X21 5 33 1 36 -12 s X2 -13 -10 -26 -40 -40 s X-29 -13 -49 -14 -60 -4 s X-10 10 -21 17 -32 20 s X-10 2 -2 4 24 4 s X26 0 61 1 104 4 s X42 2 53 14 32 36 s X0 D X210 256 m X207 264 l X216 262 l X0 D X207 264 m Xx X151 328 m X(hello world) rj 2 t X151 312 m X(hello world) rj 1 t X4 D X287 360 439 320 b X159 408 223 392 b X2 F X191 368 m X(hello world) ce 0 t X0 F X191 400 m X(hello world) ce 0 t X48 48 351 448 e X3 D X32 32 271 456 e X2 D X32 32 191 456 e X1 D X32 32 127 456 e X0 D X32 32 55 464 e X3 D X335 584 m X0 D X327 582 m X335 584 l X333 576 l X3 D X335 584 m X295 544 l X335 544 l X335 504 l X375 544 l X367 504 l X415 504 l X367 584 l X0 D X368 575 m X367 584 l X375 580 l X3 D X367 584 m Xx X135 584 m X0 D X132 576 m X135 584 l X139 576 l X3 D X135 584 m X135 504 l X175 584 l X175 504 l X215 544 l Xx X2 D X55 584 m X0 D X64 581 m X55 584 l X64 588 l X2 D X55 584 m X103 584 l X55 544 l X103 544 l X47 504 l X0 D X57 506 m X47 504 l X52 513 l X2 D X47 504 m Xx X599 704 m X599 624 l X631 704 l X631 624 l X599 608 l X0 D X609 608 m X599 608 l X605 616 l X2 D X599 608 m Xx X559 624 m X0 D X563 633 m X559 624 l X556 633 l X2 D X559 624 m X559 704 l X583 624 l X583 704 l X559 720 l Xx X1 D X511 624 m X0 D X515 633 m X511 624 l X508 633 l X1 D X511 624 m X511 704 l X535 624 l X535 704 l X0 D X532 696 m X535 704 l X539 696 l X1 D X535 704 m Xx X471 624 m X471 704 l X495 624 l X495 704 l X0 D X492 696 m X495 704 l X499 696 l X1 D X495 704 m Xx X391 624 m X0 D X395 633 m X391 624 l X388 633 l X1 D X391 624 m X391 696 l X415 624 l X415 704 l X455 624 l Xx X0 D X335 704 m X0 D X335 695 m X335 704 l X343 699 l X0 D X335 704 m X375 624 l X335 624 l X375 704 l X375 664 l X0 D X379 673 m X375 664 l X372 673 l X0 D X375 664 m Xx X295 704 m X303 640 l X311 696 l X319 624 l X0 D X322 633 m X319 624 l X315 632 l X0 D X319 624 m Xx X239 704 m X0 D X236 696 m X239 704 l X243 696 l X0 D X239 704 m X239 624 l X263 704 l X263 624 l X279 704 l Xx X4 D X175 624 m X175 704 l X215 624 l X215 704 l Xx X3 D X111 624 m X111 704 l X151 624 l X151 704 l Xx X2 D X55 704 m X55 624 l X95 704 l X95 624 l Xx X1 D X599 824 m X599 744 l X639 744 l X639 824 l Xx X0 D X535 824 m X535 744 l X575 744 l X575 824 l Xx X4 D X399 792 471 768 b X3 D X383 800 487 760 b X2 D X367 816 503 744 b X1 D X223 832 319 800 b X0 D X183 776 343 744 b X55 824 151 752 b X%%Trailer Xshowpage X% Trailer for xpic to PostScript converter X% $Header: x2ps.tra,v 1.1 87/11/21 20:33:03 moraes Exp $ Xxpic end restore X%%DocumentFonts: Times-Roman Times-Italic Times-Bold Special END_OF_FILE if test 8911 -ne `wc -c <'xpic/test/test.ps'`; then echo shar: \"'xpic/test/test.ps'\" unpacked with wrong size! fi # end of 'xpic/test/test.ps' fi if test -f 'xpic/test/test.ps.land' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xpic/test/test.ps.land'\" else echo shar: Extracting \"'xpic/test/test.ps.land'\" \(8949 characters\) sed "s/^X//" >'xpic/test/test.ps.land' <<'END_OF_FILE' X%! X%%Creator: root@bay.csri (Operator) X%%Title: test.xpic.land (xpic) X%%CreationDate: Thu May 5 00:33:12 1988 X%%Pages: 1 X%%DocumentFonts: (atend) X%%BoundingBox: 115.2 28.8 612 806.4 X% (in inches) at 1.6 0.4, width 6.9, height 10.8 X%%EndComments X% Prolog for xpic to PostScript converter X% Author: Mark Moraes X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp X% %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH X% %d F - change font ROMAN, BOLD, ITALIC, SPECIAL X% %d S - change size (font size in points) X% (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE) X% (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE) X% (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE) X% %d %d l - lineto X% %d %d m - moveto X% %d %d s - spline segment X% x - flush line, spline X% <wid> <ht> <x> <y> b - box X% <wid> <ht> <x> <y> e - ellipse X% %d ss - setscale X% %d W - change linewidth Xsave 50 dict begin /xpic exch def X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def X% Set defaults X/fontname /Times-Roman def X/ptsize 12 def X% xpic has 4 fonts R, B, I, S X/nfonts 4 def X/fonts /Times-Roman /Times-Bold /Times-Italic /Symbol nfonts array astore def X% halign has the values for MIDLINE, TOPLINE, BOTLINE X/halign 3 array def X/s {rcurveto} def X/x {stroke} def X/l {lineto} def X/m {moveto} def X/b { X /ury exch def /urx exch def /lly exch def /llx exch def X llx lly moveto urx lly lineto urx ury lineto X llx ury lineto llx lly lineto stroke X} def X/mtrx matrix def X/e { X /yc exch def /xc exch def /yrad exch def /xrad exch def X xc xrad add yc moveto X /savematrix mtrx currentmatrix def X xc yc translate X xrad yrad scale X 0 0 1 0 360 arc X savematrix setmatrix stroke X} def X% The next three take the text string, and moveto the right horiz. position X% leaving the string on the stack. X/lj {} def X/rj {dup stringwidth pop neg 0 rmoveto} def X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def X% And this is invoked after one of the three above, and X% computes the vert. pos, and then displays the string. X/t {halign exch get 0 exch rmoveto show newpath} def X% Store an array of patterns in /styles - a pattern is an array consisting X% of an array and an offset. Corresp to xpic patterns X% solid, dotted, short-dashed, long-dashed, dot-dashed X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ] X 5 array astore def X% change style to arg. X/D {stroke styles exch get aload pop setdash newpath} def X/W {stroke setlinewidth newpath} def X% fontbox takes a fontname of the stack, and returns an array X% containing the values of the bottom line of the bounding box, the X% mid line of the bounding box, and the top line of the bounding box X% of that font, taken from the baseline, scaled to a font of size 1 X/fontbox { X findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop X /ytop exch def pop /ybot exch def pop X /ymid ytop ybot sub 2 div def X 0 ybot fm dtransform exch pop % botline X dup neg exch % midline - this works better than (ytop-ybot)/2! X 0 ytop fm dtransform exch pop exch %topline X % now in the order midline, topline, botline. X 3 array astore X} def X% fontboxes stores the fontbox of each of the fontnames in the 'fonts' X% array X/fontboxes nfonts array def X0 1 nfonts 1 sub { X fontboxes exch dup fonts exch get fontbox put X} for X% select font X/F { X dup fonts exch get /fontname exch def fontboxes exch get X /thisfontbox exch def SF X} def X% set point size X/S {/ptsize exch def SF} def X% actually set font X/SF { X fontname findfont ptsize curscale div scalefont setfont X thisfontbox aload pop X 1 1 3 { X pop ptsize mul curscale div neg 3 1 roll X } for X halign astore pop X} def X% sets the scale to 72 / n, where n is on the stack, and stores the value X% in curscale for font scaling X/curscale 1 def X/ss {/curscale exch 72 exch div dup dup scale def} def X/land {8.5 72 mul curscale div 0 translate 90 rotate} def XStartXpic X%%EndProlog Xland X1 1 scale X100 ss X4 D X195 130 275 110 b X0 F X12 S X185 80 m X(hello world) rj 1 t X2 D X785 280 m X0 D X795 279 m X785 280 l X793 286 l X2 D X785 280 m X0 0 6 1 20 5 s X13 3 20 -1 20 -15 s X0 -13 1 -20 5 -20 s X3 0 10 1 20 5 s X10 3 18 10 25 20 s X6 10 11 1 15 -25 s X3 -26 3 -43 0 -50 s X-3 -6 -10 -10 -20 -10 s X-10 0 -15 3 -15 10 s X0 6 -6 5 -20 -5 s X-13 -10 -20 -18 -20 -25 s X0 -6 16 -10 50 -10 s X0 D X857 164 m X865 160 l X857 157 l X2 D X865 160 m Xx X3 F X235 90 m X(hello world) ce 0 t X4 D X185 100 285 80 b X0 D X40 20 555 270 e X2 D X60 20 575 200 e X0 F X18 S X595 110 m X(hello world) lj 2 t X1 D X75 10 690 260 e X12 S X445 140 m X(top center) ce 1 t X3 D X55 35 700 185 e X4 D X355 140 545 90 b X445 90 m X(bottom center) ce 2 t X545 90 m X(lj top \(moved\)) lj 1 t X925 190 m X0 D X935 189 m X925 190 l X933 196 l X4 D X925 190 m X0 0 15 3 45 10 s X30 6 40 -5 30 -35 s X-10 -30 -21 -43 -35 -40 s X-13 3 -20 8 -20 15 s X0 6 18 5 55 -5 s X36 -10 56 -21 60 -35 s X3 -13 -13 -26 -50 -40 s X-36 -13 -63 -13 -80 0 s X-16 13 -25 21 -25 25 s X0 3 3 5 10 5 s X6 0 18 -3 35 -10 s X16 -6 41 16 75 70 s X0 D X1017 146 m X1025 150 l X1025 141 l X4 D X1025 150 m Xx X3 D X915 280 m X0 D X925 280 m X915 280 l X922 287 l X3 D X915 280 m X0 0 10 3 30 10 s X20 6 30 -6 30 -40 s X0 -33 -11 -46 -35 -40 s X-23 6 -35 11 -35 15 s X0 3 11 5 35 5 s X23 0 56 5 100 15 s X43 10 60 20 50 30 s X-10 10 -23 10 -40 0 s X-16 -10 -11 -38 15 -85 s X0 D X1065 200 m X1065 190 l X1058 196 l X3 D X1065 190 m Xx X1 D X985 480 m X0 D X994 478 m X985 480 l X993 486 l X1 D X985 480 m X0 0 13 1 40 5 s X26 3 31 -10 15 -40 s X-16 -30 -25 -36 -25 -20 s X0 16 10 25 30 25 s X20 0 33 -3 40 -10 s X6 -6 -3 -25 -30 -55 s X-26 -30 -66 -45 -120 -45 s X0 D X944 337 m X935 340 l X944 344 l X1 D X935 340 m Xx X0 D X805 440 m X0 D X814 437 m X805 440 l X814 444 l X0 D X805 440 m X0 0 13 0 40 0 s X26 0 33 -8 20 -25 s X-13 -16 -15 -26 -5 -30 s X10 -3 25 -5 45 -5 s X20 0 16 -10 -10 -30 s X-26 -20 -50 -30 -70 -30 s X0 D X834 317 m X825 320 l X834 324 l X0 D X825 320 m Xx X835 600 m X0 D X844 597 m X835 600 l X844 604 l X0 D X835 600 m X0 0 15 0 45 0 s X30 0 48 -10 55 -30 s X6 -20 -1 -33 -25 -40 s X-23 -6 -35 -5 -35 5 s X0 10 11 11 35 5 s X23 -6 43 -13 60 -20 s X16 -6 26 0 30 20 s X3 20 1 33 -5 40 s X-6 6 -20 -3 -40 -30 s X-20 -26 -31 -45 -35 -55 s X-3 -10 -18 -15 -45 -15 s Xx X865 730 m X0 0 -10 -6 -30 -20 s X-20 -13 -13 -18 20 -15 s X33 3 63 8 90 15 s X26 6 41 1 45 -15 s X3 -16 -13 -33 -50 -50 s X-36 -16 -61 -18 -75 -5 s X-13 13 -26 21 -40 25 s X-13 3 -3 5 30 5 s X33 0 76 1 130 5 s X53 3 66 18 40 45 s X0 D X1028 712 m X1025 720 l X1034 718 l X0 D X1025 720 m Xx X185 100 m X(hello world) rj 2 t X4 D X195 160 275 140 b X195 200 275 180 b X1 F X235 120 m X(hello world) ce 0 t X2 F X235 150 m X(hello world) ce 0 t X0 F X235 190 m X(hello world) ce 0 t X65 40 100 160 e X60 60 435 250 e X3 D X40 40 335 260 e X2 D X40 40 235 260 e X1 D X40 40 155 260 e X0 D X40 40 65 270 e X4 D X715 320 m X715 420 l X765 320 l X765 420 l X725 310 l X0 D X732 317 m X725 310 l X725 320 l X4 D X725 310 m Xx X645 320 m X0 D X649 329 m X645 320 l X642 329 l X4 D X645 320 m X645 420 l X685 320 l X685 420 l Xx X515 420 m X0 D X515 411 m X515 420 l X523 415 l X4 D X515 420 m X565 320 l X565 420 l X615 320 l X615 370 l X0 D X612 362 m X615 370 l X619 362 l X4 D X615 370 m Xx X3 D X415 420 m X0 D X407 418 m X415 420 l X413 412 l X3 D X415 420 m X365 370 l X415 370 l X415 320 l X465 370 l X455 320 l X515 320 l X455 420 l X0 D X456 411 m X455 420 l X463 416 l X3 D X455 420 m Xx X265 420 m X365 420 l X265 320 l X365 320 l X0 D X357 324 m X365 320 l X357 317 l X3 D X365 320 m Xx X165 420 m X0 D X162 412 m X165 420 l X169 412 l X3 D X165 420 m X165 320 l X215 420 l X215 320 l X265 370 l Xx X2 D X65 420 m X0 D X74 417 m X65 420 l X74 424 l X2 D X65 420 m X125 420 l X65 370 l X125 370 l X55 320 l X0 D X65 322 m X55 320 l X60 329 l X2 D X55 320 m Xx X745 570 m X745 470 l X785 570 l X785 470 l X745 450 l X0 D X755 450 m X745 450 l X751 458 l X2 D X745 450 m Xx X695 470 m X0 D X699 479 m X695 470 l X692 479 l X2 D X695 470 m X695 570 l X725 470 l X725 570 l X695 590 l Xx X1 D X635 470 m X0 D X639 479 m X635 470 l X632 479 l X1 D X635 470 m X635 570 l X665 470 l X665 570 l X0 D X662 562 m X665 570 l X669 562 l X1 D X665 570 m Xx X585 470 m X585 570 l X615 470 l X615 570 l X0 D X612 562 m X615 570 l X619 562 l X1 D X615 570 m Xx X485 470 m X0 D X489 479 m X485 470 l X482 479 l X1 D X485 470 m X485 560 l X515 470 l X515 570 l X565 470 l Xx X0 D X415 570 m X0 D X415 561 m X415 570 l X423 565 l X0 D X415 570 m X465 470 l X415 470 l X465 570 l X465 520 l X0 D X469 529 m X465 520 l X462 529 l X0 D X465 520 m Xx X365 570 m X375 490 l X385 560 l X395 470 l X0 D X398 479 m X395 470 l X391 478 l X0 D X395 470 m Xx X295 570 m X0 D X292 562 m X295 570 l X299 562 l X0 D X295 570 m X295 470 l X325 570 l X325 470 l X345 570 l Xx X4 D X215 470 m X215 570 l X265 470 l X265 570 l Xx X3 D X135 470 m X135 570 l X185 470 l X185 570 l Xx X2 D X65 570 m X65 470 l X115 570 l X115 470 l Xx X1 D X745 720 m X745 620 l X795 620 l X795 720 l Xx X0 D X665 720 m X665 620 l X715 620 l X715 720 l Xx X4 D X495 680 585 650 b X3 D X475 690 605 640 b X2 D X455 710 625 620 b X1 D X275 730 395 690 b X0 D X225 660 425 620 b X65 720 185 630 b X%%Trailer Xshowpage X% Trailer for xpic to PostScript converter X% $Header: x2ps.tra,v 1.1 87/11/21 20:33:03 moraes Exp $ Xxpic end restore X%%DocumentFonts: Times-Roman Times-Italic Times-Bold Special END_OF_FILE if test 8949 -ne `wc -c <'xpic/test/test.ps.land'`; then echo shar: \"'xpic/test/test.ps.land'\" unpacked with wrong size! fi # end of 'xpic/test/test.ps.land' fi if test -f 'xpic/xsimple.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xpic/xsimple.c'\" else echo shar: Extracting \"'xpic/xsimple.c'\" \(9008 characters\) sed "s/^X//" >'xpic/xsimple.c' <<'END_OF_FILE' X/* Dumb program to experiment with dash styles - cannibalized from plotspice */ X X#include <stdio.h> X#include <string.h> X#include <X11/Xlib.h> X#include <X11/Xutil.h> X XDisplay *dpy; XWindow win; XGC gc; X#define WINNAME "dashdesign" X X/* X * Each line consists of the length of the ON, followed by the length X * of the OFF dash, PostScript style. X */ Xchar dashlist[32]; Xchar *progname; X XXFontStruct *xfont; X X#define xfontnamesmall "8x13" X#define xfontnamebig "cour.b.18" X X#define xfontwidththresh 1200 /* use big font if screen wider than this */ X XXPoint line_xvertices[] = { X {0, 0}, X {200, 200}, X {0, 200}, X {200, 0}, X {200, 200}, X}; Xint nvertices = 5; X Xint window_x, window_y, window_xorg, window_yorg; Xint window_ysize100 = 25; Xint window_xsize100 = 25; Xint window_borderwidth = 3; X Xsetdashes(dashes, n) Xchar *dashes; X{ X int i; X printf("dashlist is { "); X for(i = 0; i < n; i++) X printf("%d ", dashes[i]); X printf(" }\n"); X (void) fflush(stdout); X XSetDashes(dpy, gc, 0, dashes, n); X XClearWindow(dpy, win); X XDrawLines (dpy, win, gc, line_xvertices, nvertices, CoordModeOrigin); X XFlush(dpy); X} X Xmain(argc, argv) Xchar **argv; X{ X char buf[128]; X char *s, *s1; X int i = 0; X X progname = argv[0]; X X CreateXWindow(); X while((s = gets(buf)) != NULL) { X while((s1 = strtok(s, " \t\n")) != NULL) { X dashlist[i++] = atoi(s1); X s = NULL; X } X setdashes(dashlist, i); X i = 0; X } X} X X X/* X * This creates the X Window, gets some rudimentary defaults from the X * defaults file, - no, we don't use the resource manager yet! - and X * returns. All useful stuff is in global variables, notably dpy, win, X * gc, and xfont. It uses the global variable progname, which is X * assumed to contain the basename(argv[0]). And it expects WINNAME to X * be defined to the string that is used for the window name. Basically X * modified from Dave Rosenthal's hellow world using Xlib program. X * Purists who like the X Toolkit can try writing a %$@$#% graph X * widget. Gah! X */ X#define ARG_FONT "font" X#define ARG_BORDER_COLOR "bordercolor" X#define ARG_FOREGROUND "foreground" X#define ARG_BACKGROUND "background" X#define ARG_BORDER "border" X#define ARG_GEOMETRY "geometry" X#define DEFAULT_GEOMETRY "" XXWMHints xwmh = { X (InputHint|StateHint), /* flags */ X False, /* input */ X NormalState, /* initial_state */ X 0, /* icon pixmap */ X 0, /* icon window */ X 0, 0, /* icon location */ X 0, /* icon mask */ X 0, /* Window group */ X}; X XCreateXWindow() X{ X char *fontName; /* Name of font for string */ X XFontStruct *fontstruct; /* Font descriptor */ X unsigned long ftw, fth, pad; /* Font size parameters */ X unsigned long fg, bg, bd; /* Pixel values */ X unsigned long bw; /* Border width */ X char *tempstr; /* Temporary string */ X XColor color; /* Temporary color */ X Colormap cmap; /* Color map to use */ X XGCValues gcv; /* Struct for creating GC */ X XEvent event; /* Event received */ X XSizeHints xsh; /* Size hints for window manager */ X char *geomSpec; /* Window geometry string */ X XSetWindowAttributes xswa; /* Temporary Set Window Attribute struct */ X /* Stuff returned from the XGetGeometry on the RootWindow */ X Window dummyWindow; X int width, height; X int x, y; X int depth, borderwidth; X X dpy = XOpenDisplay ((char *) NULL); X if (dpy == NULL) X { (void) fprintf (stderr, "%s: Can't get display %s\n", X progname, XDisplayName(NULL)); X exit (2); X } X XGetGeometry (dpy, DefaultRootWindow(dpy), &dummyWindow, &x, &y, X &width, &height, &borderwidth, &depth); X if ((fontName = XGetDefault(dpy, progname, ARG_FONT)) == NULL) X { /* Ok - choose an intelligent default */ X if (width > xfontwidththresh) X fontName = xfontnamebig; X else X fontName = xfontnamesmall; X } X if ((xfont = XLoadQueryFont(dpy, fontName)) == NULL) X { (void) fprintf(stderr, "%s: display %s doesn't know font %s\n", X progname, DisplayString(dpy), fontName); X exit(1); X } X fth = xfont->max_bounds.ascent + xfont->max_bounds.descent; X ftw = xfont->max_bounds.width; X X /* X * Select colors for the border, the window background, and the X * foreground. We use the default colormap to allocate the colors in. X * See Sections 2.2.1, 5.1.2, & 10.4. X */ X cmap = DefaultColormap(dpy, DefaultScreen(dpy)); X if ((tempstr = XGetDefault(dpy, progname, ARG_BORDER_COLOR)) == NULL || X XParseColor(dpy, cmap, tempstr, &color) == 0 || X XAllocColor(dpy, cmap, &color) == 0) { X bd = BlackPixel(dpy, DefaultScreen(dpy)); X } X else X { bd = color.pixel; X } X if ((tempstr = XGetDefault(dpy, progname, ARG_BACKGROUND)) == NULL || X XParseColor(dpy, cmap, tempstr, &color) == 0 || X XAllocColor(dpy, cmap, &color) == 0) { X bg = WhitePixel(dpy, DefaultScreen(dpy)); X } X else X { bg = color.pixel; X } X if ((tempstr = XGetDefault(dpy, progname, ARG_FOREGROUND)) == NULL || X XParseColor(dpy, cmap, tempstr, &color) == 0 || X XAllocColor(dpy, cmap, &color) == 0) { X fg = BlackPixel(dpy, DefaultScreen(dpy)); X } X else X { fg = color.pixel; X } X /* X * Set the border width of the window. X */ X pad = 0; X if ((tempstr = XGetDefault(dpy, progname, ARG_BORDER)) == NULL) X bw = window_borderwidth; X else X bw = atoi(tempstr); X X /* X * Deal with providing the window with an initial position & size. X * Fill out the XSizeHints struct to inform the window manager. See X * Sections 9.1.6 & 10.3. X */ X geomSpec = XGetDefault(dpy, progname, ARG_GEOMETRY); X if (geomSpec == NULL) X { /* X * The defaults database doesn't contain a specification of the X * initial size & position - fit the window to the text and locate X * it in the center of the screen. X */ X xsh.flags = (PPosition | PSize); X xsh.width = window_x = width * window_xsize100 / 100; X xsh.height = window_y = height * window_ysize100 / 100; X xsh.x = window_xorg = width * (95 - window_xsize100) / 100; X xsh.y = window_yorg = height / 20; X } X else X { int bitmask; X X bzero(&xsh, sizeof(xsh)); X bitmask = XGeometry(dpy, DefaultScreen(dpy), geomSpec, X DEFAULT_GEOMETRY,bw, ftw, fth, pad, pad, &(xsh.x), &(xsh.y), X &(xsh.width), &(xsh.height)); X if (bitmask & (XValue | YValue)) X { xsh.flags |= USPosition; X } X if (bitmask & (WidthValue | HeightValue)) X { xsh.flags |= USSize; X } X } X X /* X * Create the Window with the information in the XSizeHints, the X * border width, and the border & background pixels. See Section 3.3. X */ X win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), X xsh.x, xsh.y, xsh.width, xsh.height, X bw, bd, bg); X X /* X * Set the standard properties for the window managers. See Section X * 9.1. X */ X XSetStandardProperties(dpy, win, WINNAME, WINNAME, None, &progname, 1, X &xsh); X XSetWMHints(dpy, win, &xwmh); X X /* X * Ensure that the window's colormap field points to the default X * colormap, so that the window manager knows the correct colormap to X * use for the window. See Section 3.2.9. Also, set the window's Bit X * Gravity to reduce Expose events. X */ X xswa.colormap = DefaultColormap(dpy, DefaultScreen(dpy)); X xswa.bit_gravity = CenterGravity; X XChangeWindowAttributes(dpy, win, (CWColormap | CWBitGravity), &xswa); X X /* X * Create the GC for writing the text. See Section 5.3. X */ X gcv.font = xfont->fid; X gcv.foreground = fg; X gcv.background = bg; X gcv.line_width = 1; X gcv.line_style = LineOnOffDash; X gc = XCreateGC(dpy, win, (GCFont | GCForeground | GCBackground X | GCLineWidth | GCLineStyle), &gcv); X X /* X * Specify the event types we're interested in - only Exposures. See X * Sections 8.5 & 8.4.5.1 X */ X XSelectInput(dpy, win, ExposureMask); X X /* X * Map the window to make it visible. See Section 3.5. X */ X XMapWindow(dpy, win); X X /* X * Loop forever, examining each event. We neeed to do this X * because, unlike X10, X11 does not guarantee that the window X * is mapped when it comes back from an XMapWindow. So we wait X * till we get an Exposure Event - then we know we can go ahead. X */ X while (1) { X /* X * Get the next event X */ X XNextEvent(dpy, &event); X X /* X * On the last of each group of Expose events, repaint the entire X * window. See Section 8.4.5.1. X */ X if (event.type == Expose && event.xexpose.count == 0) X { XWindowAttributes xwa; /* Temp Get Window Attribute struct */ X int x, y; X X /* X * Remove any other pending Expose events from the queue to X * avoid multiple repaints. See Section 8.7. X */ X while (XCheckTypedEvent(dpy, Expose, &event)); X X /* X * Find out how big the window is now, so that we can center X * the text in it. X */ X if (XGetWindowAttributes(dpy, win, &xwa) == 0) X break; X window_x = xwa.width; X window_y = xwa.height; X /* X * Fill the window with the background color. X */ X XClearWindow(dpy, win); X /* We don't want any more events */ X XSelectInput(dpy, win, (unsigned long) 0); X gcv.graphics_exposures = False; X XChangeGC(dpy, gc, (GCGraphicsExposures), &gcv); X XSync(dpy, 1); X break; X } X } X} END_OF_FILE if test 9008 -ne `wc -c <'xpic/xsimple.c'`; then echo shar: \"'xpic/xsimple.c'\" unpacked with wrong size! fi # end of 'xpic/xsimple.c' fi echo shar: End of archive 6 \(of 15\). cp /dev/null ark6isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 15 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0