131 static int sFontHeight,
133 static REAL sFontHcm,
135 static FILE *sHPGLFile =
NULL;
180 if((sHPGLFile = fopen(filename,
"w")) ==
NULL)
return(
FALSE);
184 xoff = (int)((
PSxoffset - xmargin) * 1024);
185 yoff = (int)((
PSyoffset - ymargin) * 1024);
187 sprintf(buffer,
"IN; IP%d,%d,%d,%d;\n",xoff,yoff,
190 fputs(buffer,sHPGLFile);
192 sprintf(buffer,
"SC0,10000,0,10000;DT\\;\n");
193 fputs(buffer,sHPGLFile);
195 sprintf(buffer,
"CA%d;SS;\n",HPGLAltFont);
196 fputs(buffer,sHPGLFile);
218 sprintf(buffer,
"SP;PU;SP%1d;\n",num);
219 fputs(buffer,sHPGLFile);
240 sprintf(buffer,
"PU;PA%d, %d;\n", (
int)(10000*x),(
int)(10000*y));
241 fputs(buffer,sHPGLFile);
262 sprintf(buffer,
"PD;PA%d, %d;\n",(
int)(10000*x),(
int)(10000*y));
263 fputs(buffer,sHPGLFile);
291 fputs(
"LT;\n",sHPGLFile);
294 fputs(
"LT1,2;\n",sHPGLFile);
297 fputs(
"LT4,3;\n",sHPGLFile);
300 fputs(
"LT2,3;\n",sHPGLFile);
303 fputs(
"LT6,3;\n",sHPGLFile);
306 fputs(
"LT5,3;\n",sHPGLFile);
336 sFontHcm = size * 2.54 / (1.7 * 72.0);
337 sFontWcm = sFontHcm/2.4;
339 sprintf(buffer,
"PU;CS%d;SS;SI%5.3f, %5.3f;\n",
340 font,sFontWcm,sFontHcm);
341 fputs(buffer,sHPGLFile);
344 sFontHeight = (int)((size * 10000.0) / (72.0 *
PSypicsize));
347 width = sFontHcm * 0.6154;
350 sFontWidth = (int)width;
374 sprintf(buffer,
"PU;PA%d, %d;",
375 (
int)(10000.0 * x),(
int)(10000.0 * y));
376 fputs(buffer,sHPGLFile);
409 xpos = (int)(10000.0 * x);
411 xpos += sFontWidth / 6;
413 ypos = (int)(10000.0 * y);
414 ypos -= (int)(offset * sFontHeight);
416 sprintf(buffer,
"PU;PA%d, %d;", xpos, ypos);
417 fputs(buffer,sHPGLFile);
450 xpos = (int)(10000.0 * x);
453 xpos += sFontWidth/6;
455 xpos += (int)((offset * 10000.0) / (72.0 *
PSxpicsize));
457 ypos = (int)(10000.0 * y);
459 ypos -= (int)(1.0 * sFontHeight / 3.0);
461 sprintf(buffer,
"PU;PA%d, %d;\n", xpos, ypos);
462 fputs(buffer,sHPGLFile);
490 xpos = (int)(10000.0 * x);
491 ypos = (int)(10000.0 * y);
494 ypos -= (int)(1.0 * sFontHeight / 3.0);
496 sprintf(buffer,
"PU;PA%d, %d;", xpos, ypos);
497 fputs(buffer,sHPGLFile);
530 xpos = (int)(10000.0 * x);
532 xpos += sFontWidth/6;
534 ypos = (int)(10000.0 * y);
538 ypos += (int)((offset * 10000.0) / (72.0 *
PSypicsize));
540 sprintf(buffer,
"PU;PA%d, %d;\n", xpos, ypos);
541 fputs(buffer,sHPGLFile);
599 (LabelSize * 10000.0) / (2.0 * 72.0 *
PSxpicsize);
619 height = TitleSize * 2.54 / (1.7 * 72.0);
625 sprintf(buffer,
"PU;SI%5.3f, %5.3f;\n",fixwidth,fixheight);
626 fputs(buffer,sHPGLFile);
630 sprintf(buffer,
"PU;PA%d,%d;DR0,1;",(
int)x,(
int)y);
631 fputs(buffer,sHPGLFile);
633 fputs(
"DR;\n",sHPGLFile);
636 sprintf(buffer,
"PU;SI%5.3f, %5.3f;\n",width,height);
637 fputs(buffer,sHPGLFile);
688 for(i=0, j=0, chcount=0; i<strlen(text) && j<
MAXBUFF-1; i++)
697 sprintf(OutBuff,
"LB%s\\;",buffer);
698 fputs(OutBuff,sHPGLFile);
702 sprintf(OutBuff,
"SA;LB%c\\;SS;",text[++i]);
703 fputs(OutBuff,sHPGLFile);
711 sprintf(OutBuff,
"LB%s\\;",buffer);
712 fputs(OutBuff,sHPGLFile);
718 if(orientation) chcount++;
724 sprintf(OutBuff,
"PU;PA%d,%d;", XBase-sFontHeight/2,
727 sprintf(OutBuff,
"PU;PA%d,%d;", XBase + chcount*sFontWidth,
728 YBase+sFontHeight/2);
729 fputs(OutBuff,sHPGLFile);
734 while(text[++i] !=
'}' && text[i] !=
'\0' && j<MAXBUFF-1)
736 buffer[j++] = text[i];
742 buffer[j++] = text[i];
757 fixheight = sFontHcm;
759 sprintf(OutBuff,
"PU;SI%f,%f;LB%s\\;PU;SI%f,%f;",
760 fixwidth,fixheight/2.0,buffer,fixwidth,fixheight);
761 fputs(OutBuff,sHPGLFile);
766 sprintf(OutBuff,
"PU;PA%d,%d;", XBase,
769 sprintf(OutBuff,
"PU;PA%d,%d;", XBase + chcount*sFontWidth,
771 fputs(OutBuff,sHPGLFile);
778 sprintf(OutBuff,
"LB%s\\;",buffer);
779 fputs(OutBuff,sHPGLFile);
785 if(orientation) chcount++;
791 sprintf(OutBuff,
"PU;PA%d,%d;", XBase+sFontHeight/4,
794 sprintf(OutBuff,
"PU;PA%d,%d;", XBase + chcount*sFontWidth,
795 YBase-sFontHeight/4);
796 fputs(OutBuff,sHPGLFile);
801 while(text[++i] !=
'}' && text[i] !=
'\0' && j<MAXBUFF-1)
803 buffer[j++] = text[i];
809 buffer[j++] = text[i];
825 fixheight = sFontHcm;
827 sprintf(OutBuff,
"PU;SI%f,%f;LB%s\\;PU;SI%f,%f;",
828 fixwidth,fixheight/2.0,buffer,fixwidth,fixheight);
829 fputs(OutBuff,sHPGLFile);
834 sprintf(OutBuff,
"PU;PA%d,%d;", XBase,
837 sprintf(OutBuff,
"PU;PA%d,%d;", XBase + chcount*sFontWidth,
839 fputs(OutBuff,sHPGLFile);
843 buffer[j++] = text[i];
852 sprintf(OutBuff,
"LB%s\\;",buffer);
853 fputs(OutBuff,sHPGLFile);
857 if(strlen(text)) fputs(
"\n",sHPGLFile);
void blHPGLCTText(REAL x, REAL y, REAL offset, char *text)
char * blSimplifyText(char *string)
void blHPGLShowText(char *text, BOOL orientation, int XBase, int YBase)
void blHPGLCBText(REAL x, REAL y, REAL offset, char *text)
void blHPGLSetDash(int style)
Include file for using plotting routines.
void blHPGLROffText(REAL x, REAL y, REAL offset, char *text)
void blHPGLMove(REAL x, REAL y)
int blPS2HPGLFont(char *font)
void blHPGLLText(REAL x, REAL y, char *string)
System-type variable type definitions.
void blHPGLVText(REAL x, REAL y, REAL xoff, char *text, int TitleFont, REAL TitleSize, char *label, int LabelFont, REAL LabelSize)
void blHPGLLCText(REAL x, REAL y, char *text)
Type definitions for maths.
BOOL blHPGLInit(char *filename, char *AltFont, REAL xmargin, REAL ymargin)
void blHPGLDraw(REAL x, REAL y)
void blHPGLFont(int font, REAL size)