Changeset 1846 in Sophya
- Timestamp:
- Dec 31, 2001, 5:18:54 PM (24 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Tests/pist.cc
r1588 r1846 95 95 for(k=0; k<10; k++) 96 96 mSL[k] = mSH[k] = 0; 97 PIFont f(1 4, PI_DefaultFont);97 PIFont f(16, PI_DefaultFont); 98 98 g->SelFont(f); 99 99 g->SelForeground(PI_Black); 100 g->DrawString(50,20,attstr[ia]); 101 g->DrawString(XSize()/2,20,fszstr[js]); 100 g->DrawString(50,24,attstr[ia]); 101 g->DrawString(XSize()/2,24,fszstr[js]); 102 int fh,fa,fd; 103 fh = f.GetFontHeight(fa, fd); 104 cout << " FontSize= " << f.GetFontSize() << " FontHeight= " << fh << endl; 105 g->DrawFBox(XSize()/2-30, 24-fh+2, fh, fh); 102 106 103 107 … … 314 318 printf("Creating EPS File %s (Encapsulated PostScript) \n", buff); 315 319 PSFile *mps; 316 mps = new PSFile(buff , 0.75);320 mps = new PSFile(buff); 317 321 mcurwin->PSPrint(mps,0,0); 318 322 delete mps; -
trunk/SophyaPI/PI/pigraphx.cc
r1640 r1846 300 300 case PI_FStarMarker : 301 301 for(k=0; k<10; k++) { 302 x[k] = (int)(starcoordx[k]* (float)mMrkSz+(float)x0+0.5);303 y[k] = (int)(starcoordy[k]* (float)mMrkSz+(float)y0+0.5);302 x[k] = (int)(starcoordx[k]*hmsz+(float)x0+0.5); 303 y[k] = (int)(starcoordy[k]*hmsz+(float)y0+0.5); 304 304 } 305 305 x[10] = x[0]; y[10] = y[0]; … … 719 719 double pio52 = pio5/2.; 720 720 double cpi2 = M_PI/2.-pio5; 721 double re = 1.2; // Rayon externe 722 double ri = 0.5; // rayon interne pour rext=1.2 721 // Pentagone inscrit dans un cercle de rayon R1 = 1 722 // les pointes de l'etoile seront inscrites dans un cercle 723 // de rayon R2 = 2.61803 724 double re = 1.; // Rayon externe 725 double ri = 0.38; // rayon interne pour rext=1.2 723 726 for(int k=0; k<5; k++) { 724 727 starcoordx[2*k] = cos(k*pio5+cpi2)*re; -
trunk/SophyaPI/PI/psfile.cc
r1640 r1846 234 234 /PITriangle {0 750 m 375 0 l 750 750 l c s} bind def\n\ 235 235 /PIFTriangle {0 750 m 375 0 l 750 750 l c f} bind def\n\ 236 /PIStar {} def\n\ 237 /PIFStar {} def\n\ 236 /PIStar {731 260 m 459 260 l 375 0 l 291 260 l 19 260 l \ 237 239 419 l 155 678 l 375 518 l 595 678 l 511 419 l c s} def\n\ 238 /PIFStar {731 260 m 459 260 l 375 0 l 291 260 l 19 260 l \ 239 239 419 l 155 678 l 375 518 l 595 678 l 511 419 l c f} def\n\ 238 240 end %%$PIDict\n\ 239 241 end %%$CharProcs\n\ … … 245 247 Encoding exch get\n\ 246 248 CharProcs exch get\n\ 247 end exec} def\n\249 end 75 slw exec} def\n\ 248 250 end\n\ 249 251 /PIMarkers $PIMarkers definefont pop\n\ … … 303 305 /* Definition de la resolution coordonnees user par defaut (point/cm ou pixels/cm) */ 304 306 305 int PSFile::def_user_resol_X = 30; 306 int PSFile::def_user_resol_Y = 30; 307 void PSFile::SetDefaultUserResolution(int resx, int resy) 307 float PSFile::postscript_resolution = 28.; /* environ 72 points / pouce */ 308 float PSFile::def_user_resol_X = 30.; /* environ 75 points / pouce */ 309 float PSFile::def_user_resol_Y = 30.; 310 float PSFile::def_user_resolution = 30.; 311 312 void PSFile::SetUserCoordResolution(float resx, float resy) 308 313 { 309 if ((resx < 1 ) || (resy < 1)) return;314 if ((resx < 1.) || (resy < 1.)) return; 310 315 def_user_resol_X = resx; 311 316 def_user_resol_Y = resy; 312 } 313 void PSFile::GetDefaultUserResolution(int& resx, int& resy) 317 def_user_resolution = 0.5*(resx+resy); 318 } 319 float PSFile::GetUserCoordResolution(float& resx, float& resy) 314 320 { 315 if ((resx < 1) || (resy < 1)) return;316 321 resx = def_user_resol_X; 317 322 resy = def_user_resol_Y; 318 } 319 323 return (def_user_resolution); 324 } 325 float PSFile::PSCoordResolution() 326 { 327 return (postscript_resolution); 328 } 320 329 321 330 /* … … 563 572 boundingBox = 0 ; 564 573 } /* BB */ 574 /* facteur d'echelle pour les fontes*/ 575 currentPage->FontScaleFactor = 1.1*scale; 576 // postscript_resolution/def_user_resolution*scale; 577 /* 578 cout << " EPS_DBG_FontScaleFactor = " << currentPage->FontScaleFactor 579 << " scale= " << scale << " postscript_resolution= " 580 << postscript_resolution << " def_user_resolution= " 581 << def_user_resolution << endl; 582 */ 565 583 } /* EPS */ 566 584 /* … … 614 632 tw, th, 615 633 0.5*(Tw-tw), -0.5*(Th+th)) ; 616 } 634 } /* End if .Portrait */ 617 635 if(currentPage->orientation == PI_Landscape) { 618 636 /* Idem avec X<->Y */ … … 637 655 th, tw, 638 656 0.5*(Th-th), 0.5*(Tw-tw)); 639 } 657 } /* End if .Landscape */ 658 /* facteur d'echelle pour les fontes*/ 659 currentPage->FontScaleFactor = 1.2*scale*postscript_resolution; 660 /* 661 cout << " PS_DBG_FontScaleFactor = " << currentPage->FontScaleFactor 662 << " scale= " << scale << " postscript_resolution= " 663 << postscript_resolution << " def_user_resolution= " 664 << def_user_resolution << endl; 665 */ 640 666 } /* End if .ps */ 641 667 // On redefint la fonte par defaut - $CHECK$ Reza 11/12/99 … … 772 798 bool change = false; 773 799 800 FontSize = (float)FontSize*currentPage->FontScaleFactor; 774 801 /* Couleurs */ 775 802 if ( (DrawColor != PI_NotDefColor) && (DrawColor != mDrawColor) ) { … … 1066 1093 if(MarkerSize != mMarkerSize || setFontDone) { 1067 1094 mMarkerSize = MarkerSize ; 1068 fprintf(mPSFile, "/PIMarkers ff %d scf sf\n", mMarkerSize) ; 1095 fprintf(mPSFile, "/PIMarkers ff %d scf sf\n", 1096 (int)(mMarkerSize*currentPage->FontScaleFactor)) ; 1069 1097 setFontDone = false ; 1070 1098 } … … 1093 1121 if(MarkerSize != mMarkerSize || setFontDone) { 1094 1122 mMarkerSize = MarkerSize ; 1095 fprintf(mPSFile, "/PIMarkers ff %d scf sf\n", mMarkerSize) ; 1123 fprintf(mPSFile, "/PIMarkers ff %d scf sf\n", 1124 (int)(mMarkerSize*currentPage->FontScaleFactor)) ; 1096 1125 setFontDone = false ; 1097 1126 } -
trunk/SophyaPI/PI/psfile.h
r1592 r1846 72 72 public: 73 73 /* Definition de la resolution coordonnees user par defaut (point/cm) */ 74 static void SetDefaultUserResolution(int resx, int resy); 75 static void GetDefaultUserResolution(int & resx, int & resy); 74 static void SetUserCoordResolution(float resx, float resy); 75 static float GetUserCoordResolution(float & resx, float & resy); 76 static float PSCoordResolution(); 76 77 77 78 /* Production fichier eps */ … … 80 81 PSFile (const char * FileName, PIOrientation orientation, 81 82 PIPaperSize paperSize= PI_A4, 82 double marginX = 5.0, double marginY = 5.0 ) ;83 double marginX = 3.0, double marginY = 3.0 ) ; 83 84 84 85 virtual ~PSFile(); … … 170 171 int BlocCounter; 171 172 double Dx,Dy; /* Sommet SE (unites utilisateur) */ 173 float FontScaleFactor; /* Facteur d'echelle pour les fontes */ 172 174 PIOrientation orientation; 173 175 long begin, end, tmp; /* Offsets dans le fichier */ … … 207 209 208 210 /* resolution coordonnees user (point/cm - pixels/cm) */ 209 static int def_user_resol_X, def_user_resol_Y; 211 static float def_user_resol_X, def_user_resol_Y; 212 static float def_user_resolution; 213 /* resolution coordonnees PostScript (point/cm - pixels/cm) */ 214 static float postscript_resolution; 210 215 } ; 211 216
Note:
See TracChangeset
for help on using the changeset viewer.