Index: trunk/SophyaPI/PI/Tests/pit1.cc
===================================================================
--- trunk/SophyaPI/PI/Tests/pit1.cc	(revision 381)
+++ trunk/SophyaPI/PI/Tests/pit1.cc	(revision 382)
@@ -104,6 +104,24 @@
 g->DrawFBox(10, 60, 120, 20);
 
+PIFont f0;
+g->SelFont(f0);
 g->SelForeground(PI_Black);
 g->DrawString(20, 110, str);
+PIFont f(PI_TimesFont);
+g->SelFont(f);
+g->DrawString(20, 130, "Times-Font");
+PIFont f2(14,PI_CourierFont,PI_BoldFont);
+g->SelFont(f2);
+g->DrawString(20, 150, "Courier-Font");
+PIFont f3(14,PI_TimesFont,PI_BoldFont);
+g->SelFont(f3);
+g->DrawString(20, 170, "Times-Font");
+PIFont f4(14,PI_HelveticaFont,PI_BoldFont);
+g->SelFont(f4);
+g->DrawString(20, 190, "Helvetica-Font");
+PIFont f5(14,PI_SymbolFont,PI_BoldFont);
+g->SelFont(f5);
+g->DrawString(20, 210, "Symbol-Font");
+
 
 g->SelLine(PI_ThinLine);
@@ -118,4 +136,7 @@
 g->SelForeground(PI_Grey);
 g->DrawFCircle(120, 60, 15);
+
+
+
 
 PIGrCoord x[5] = { 20, 35, 50, 65, 80 };
@@ -367,4 +388,5 @@
 m[0]->AppendItem("New ExBwdg", 10102);
 m[0]->AppendItem("New ScSample", 10103);
+m[0]->AppendItem("->eps", 10111);
 m[0]->AppendItem("Exit", 10105);
 // On accroche le menu au Menubar
@@ -398,4 +420,5 @@
 }  
 
+static int numpsf = 0;
 static int nbwin = 0;
 /* --Methode-- */
@@ -460,4 +483,15 @@
       break;
 
+    case 10111:          // -> eps
+      if (mcurwin) {
+        char buff[64];
+        sprintf(buff, "pit_%d.eps", numpsf);        numpsf++;
+        printf("Creating EPS File %s (Encapsulated PostScript) \n", buff);
+        PSFile *mps;
+	mps = new PSFile(buff);
+	mcurwin->PSPrint(mps,0,0);
+	delete mps;
+        }
+      break;        
     case 10105:          // Sortie d'application
       Stop();
Index: trunk/SophyaPI/PI/pigraphps.cc
===================================================================
--- trunk/SophyaPI/PI/pigraphps.cc	(revision 381)
+++ trunk/SophyaPI/PI/pigraphps.cc	(revision 382)
@@ -82,5 +82,5 @@
 mLAtt = PI_ThinLine;
 SelLine();
-mFAtt = PI_BoldFont;  mFSize = 0;
+// mFAtt = PI_BoldFont;  mFSize = 0;  $CHECK$ Plus besoin 
 SelFont();
 SelMarker(1, PI_DotMarker);
@@ -111,5 +111,10 @@
 {
 if(mPSOut)
-  mPSOut->DrawString((double)x,(double)y,s,mFCol,mFAtt,mFSize); /* $CHECK$ PIFontSize ?? */
+  //  mPSOut->DrawString((double)x,(double)y,s,mFCol,mFAtt,mFSize); /* $CHECK$ PIFontSize ?? */
+  mPSOut->DrawString((double)x,(double)y,s,mFCol, myFont.GetFontName(),
+                     myFont.GetFontAtt(),  myFont.GetFontSize());
+// Calculez la taille de la boite occupe par la fonte
+//  myFont.GetFontHeight(int& asc, int& desc)  Tres proche de myFont.GetFontSize() en principe
+//  myFont.GetStringWidth(char const* s)  Largeur occupe par la chaine
 return;
 }
@@ -119,5 +124,8 @@
 {
 if(mPSOut)
-  mPSOut->DrawString((double)x,(double)y,s,mFCol,mFAtt,mFSize); /* $CHECK$ PIFontSize ?? */
+  //  mPSOut->DrawString((double)x,(double)y,s,mFCol,mFAtt,mFSize); /* $CHECK$ PIFontSize ?? */
+  mPSOut->DrawString((double)x,(double)y,s,mFCol, myFont.GetFontName(), 
+                     myFont.GetFontAtt(),  myFont.GetFontSize());
+// Idem taille ici 
 return;
 }
@@ -251,4 +259,18 @@
 if(mPSOut)
   mPSOut->DrawMarker((double)x0,(double)y0,mMrk,mFCol,mMrkSz);
+// $CHECK$ Ajouter starmarker
+// /* Coordonnees pour une etoile a 5 branches */
+// double pio5 = M_PI/2.5;  
+// double pio52 = pio5/2.;
+// double cpi2 = M_PI/2.-pio5;  
+// double re = 1.2;  // Rayon externe
+// double ri = 0.5; //  rayon interne pour rext=1.2
+// for(int k=0; k<5; k++) {
+//  starcoordx[2*k] = cos(k*pio5+cpi2)*re;
+//  starcoordy[2*k] = -sin(k*pio5+cpi2)*re;
+//  starcoordx[2*k+1] = cos(k*pio5+pio52+cpi2)*ri;
+//  starcoordy[2*k+1] = -sin(k*pio5+pio52+cpi2)*ri;
+//  }
+
 return;
 }
@@ -331,5 +353,22 @@
 {
 //  $CHECK$   -  Reza 13/06/99
-SelFontSzPt(fnt.GetFontSize(), fnt.GetFontAtt());
+if (myFont == fnt)  return;
+myFont = fnt;
+  // C'est peu-etre mieux 
+  // SelFontSzPt(fnt.GetFontSize(), fnt.GetFontAtt());
+}
+
+
+static int fntsz[5] = {8,10,12,14,16};
+
+/* --Methode-- */
+void PIGraphicPS::SelFont(PIFontSize sz, PIFontAtt att)
+{
+//  $CHECK$   -  Reza 13/06/99
+PIFont fnt(myFont.GetFontName());
+fnt.SetFontAtt(att);
+fnt.SetFontSz(sz);
+SelFont(fnt);
+return;
 }
 
@@ -338,37 +377,6 @@
 {
 //  $CHECK$   -  Reza 13/06/99
-myFont.SetFontSzPt(npt);
-myFont.SetFontAtt(att);
-mFSize = npt;
-mFAtt = att;
-return;
-}
-
-static int fntsz[5] = {8,10,12,14,16};
-
-/* --Methode-- */
-void PIGraphicPS::SelFont(PIFontSize sz, PIFontAtt att)
-{
-//  $CHECK$   -  Reza 13/06/99
-int i;
-switch (sz) {
-  case PI_SmallSizeFont:
-    i = 0;
-    break;
-  case PI_NormalSizeFont:
-    i = 2;
-    break;
-  case PI_BigSizeFont:
-    i = 4;
-    break;
-  default:
-    i=2;
-    break;
-  }
-myFont.SetFontSz(sz);
-myFont.SetFontAtt(att);
-mFSize = fntsz[i];
-mFAtt = att;
-return;
+PIFont fnt(npt, myFont.GetFontName(), att);
+SelFont(fnt);
 }
 
Index: trunk/SophyaPI/PI/pigraphps.h
===================================================================
--- trunk/SophyaPI/PI/pigraphps.h	(revision 381)
+++ trunk/SophyaPI/PI/pigraphps.h	(revision 382)
@@ -83,7 +83,7 @@
   PIColor  mFCfMap, mBCfMap;
   PIGOMode mGOm;
-  PIFontAtt mFAtt;
+//  PIFontAtt mFAtt;  Plus besoin Reza + NR 07/08/99
   PILineAtt mLAtt;
-  int mFSize;
+//  int mFSize;    Plus besoin Reza + NR 07/08/99
   PIMarker mMrk;
   int mMrkSz;
Index: trunk/SophyaPI/PI/piwdggen.cc
===================================================================
--- trunk/SophyaPI/PI/piwdggen.cc	(revision 381)
+++ trunk/SophyaPI/PI/piwdggen.cc	(revision 382)
@@ -258,5 +258,6 @@
 psf->DrawBox(0., 0., (double)XSize(), (double)YSize());
 sprintf(str,"PIWdgGen::PSPrint() Kind=%ld Name= %s", kind(), Nom().c_str());
-psf->DrawString(12., 12., str, PI_Black, PI_RomanFont, 10);
+// N.R. 07/08/99 FontName specifie dans DrawString() 
+psf->DrawString(12., 12., str, PI_Black, PI_DefaultFont, PI_RomanFont, 10);
 psf->EndBloc();
 
Index: trunk/SophyaPI/PI/psfile.cc
===================================================================
--- trunk/SophyaPI/PI/psfile.cc	(revision 381)
+++ trunk/SophyaPI/PI/psfile.cc	(revision 382)
@@ -6,4 +6,10 @@
  *   Modification le 01/03/96
  *    - fusion psfile.cc - psdict.cc
+ *
+ *
+ *   07/08/99 : Gestion des fontes ; ajout Times/Helvetica/Symbol 
+ *              
+ * 
+ *
  *
  */
@@ -77,7 +83,7 @@
 /C%-2d  {0.195 0.800 0.195 setrgbcolor} bind def %% PI_LimeGreen\n\
 /C%-2d  {0.996 0.840 0.0   setrgbcolor} bind def %% PI_Gold\n\
-/F%-2d  {/Courier   findfont} bind def       %% PI_RomanFont\n\
-/F%-2d  {/Courier-Bold    findfont} bind def       %% PI_BoldFont\n\
-/F%-2d  {/Courier-Italic  findfont} bind def       %% PI_ItalicFont\n\
+/F%-2d  {/Courier   findfont} bind def           %% PI_RomanFont\n\
+/F%-2d  {/Courier-Bold    findfont} bind def     %% PI_BoldFont\n\
+/F%-2d  {/Courier-Italic  findfont} bind def     %% PI_ItalicFont\n\
 /F%-2d  {}\
                         bind def       %% PI_NotDefFontAtt\n\
@@ -268,5 +274,5 @@
 #define HEADER     "\
 %%%%Title: %s\n\
-%%%%Creator: PSFile\n\
+%%%%Creator: PSFile (N.R. 07/08/99)\n\
 %%%%CreationDate: %s\
 %%%%Pages: (atend)\n\
@@ -308,5 +314,6 @@
       mFillColor(PI_Black),
       mFontAtt(PI_RomanFont),
-      mFontSize(PI_NormalSizeFont),
+      mFontSize(0),
+      mFontName(PI_DefaultFont), 
       mLineAtt(PI_NormalLine),
       mMarker(PI_DotMarker),
@@ -370,5 +377,6 @@
     mFillColor(PI_Black),
     mFontAtt(PI_RomanFont),
-    mFontSize(PI_NormalSizeFont),
+    mFontSize(0),
+    mFontName(PI_DefaultFont),
     mLineAtt(PI_NormalLine),
     mMarker(PI_DotMarker), 
@@ -448,5 +456,6 @@
 }
 
-PIFontSize PSFile::GetFontSize() {
+// N.R. 07/08/99 return val PIFontSize --> int 
+int PSFile::GetFontSize() {
 
     return(mFontSize);
@@ -551,16 +560,16 @@
 
 	if(currentPage->orientation == PI_Portrait) {
-//	    if( (tw/Dx) < (th/Dy) ) 
-//		scale = tw/Dx ;
-//                scale = tw/Tw ; 
-//	    else 
-//		scale = th/Dy;
-//                scale = th/Th;
-//	    fprintf(mPSFile, 
-//		    "%.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n",
-//		    Dx, Dy, 
-//		    Dx*scale, Dy*scale, 
-//		    Tw*scale, Th*scale, 
-//		    0.5*(Tw-tw), -0.5*(Th+th)) ;
+	  //	    if( (tw/Dx) < (th/Dy) ) 
+	  //		scale = tw/Dx ;
+	  //                scale = tw/Tw ; 
+	  //	    else 
+	  //		scale = th/Dy;
+	  //                scale = th/Th;
+	  //	    fprintf(mPSFile, 
+	  //		    "%.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n",
+	  //		    Dx, Dy, 
+	  //		    Dx*scale, Dy*scale, 
+	  //		    Tw*scale, Th*scale, 
+	  //		    0.5*(Tw-tw), -0.5*(Th+th)) ;
             scale = (tw/Dx)<(th/Dy) ? tw/Dx : th/Dy ; 
             tw = scale*Dx ; th = scale*Dy ; 
@@ -698,4 +707,5 @@
 void  PSFile::DrawString  (double x,  double y, const char *s, 
 			   PIColors DrawColor, 
+			   PIFontName FontName, 
 			   PIFontAtt FontAtt, 
 			   int FontSize) {
@@ -703,18 +713,58 @@
 
     /* Couleurs */
-    if ( (DrawColor != PI_NotDefColor) || (DrawColor != mDrawColor) ) {
+    if ( (DrawColor != PI_NotDefColor) && (DrawColor != mDrawColor) ) {
 	mDrawColor = DrawColor;
 	fprintf(mPSFile, "C%d ", mDrawColor) ; 
     }
     /* Choix des fontes */
-    if ( (FontAtt != PI_NotDefFontAtt) || (FontAtt != mFontAtt) ) {
-	mFontAtt = FontAtt;
-	change = 1;}
-    if ( (FontSize != PI_NotDefFontSize) || (FontSize != mFontSize) ) {
-	mFontSize = (PIFontSize) FontSize;  // $CHECK$ EA ajoute le cast un peu au pif
-	change = 1;}
-    if (change)
-	fprintf(mPSFile, "F%d %d FS ", mFontAtt, FontSize) ; 
-
+    if ( (FontAtt != PI_NotDefFontAtt) && (FontAtt != mFontAtt) ) {
+      printf("PSFile::DrawString(%s) : FontAtt a change : %d %d \n", s, mFontAtt, FontAtt) ; 
+      mFontAtt = FontAtt;
+      change = 1;
+    }
+    if ( (FontSize != PI_NotDefFontSize) && (FontSize != mFontSize) ) {
+      printf("PSFile::DrawString(%s) : FontSize a change : %d %d \n", s, mFontSize, FontSize) ; 
+      mFontSize = (PIFontSize) FontSize;  // $CHECK$ EA ajoute le cast un peu au pif
+      change = 1;
+    }
+    if( (FontName != mFontName) ) {
+      printf("PSFile::DrawString(%s) : FontName a change : %d %d \n", s, mFontName, FontName) ; 
+      mFontName = (PIFontName) FontName ; 
+      change = 1 ; 
+    }
+    if (change) { 
+      string fname ; 
+      switch(mFontName) {
+      case PI_DefaultFont:
+      case PI_CourierFont:
+	fprintf(mPSFile, "/Courier") ; 
+	break ; 
+      case PI_HelveticaFont:
+	fprintf(mPSFile, "/Helvetica") ; 
+	break ; 
+      case PI_TimesFont:
+	fprintf(mPSFile, "/Times") ; 
+	break ; 
+      case PI_SymbolFont:
+	fprintf(mPSFile, "/Symbol ") ; 
+	break ; 
+      } // endsw 
+      
+      switch(mFontAtt) {
+      case PI_NotDefFontAtt:
+      case PI_RomanFont:
+	fprintf(mPSFile, " ") ; 
+	break ; 
+      case PI_BoldFont:
+	if(mFontName != PI_SymbolFont) fprintf(mPSFile, "-Bold ") ; 
+	break ; 
+      case PI_ItalicFont:
+	if(mFontName != PI_SymbolFont) fprintf(mPSFile, "-Italic ") ; 
+	break ; 
+      } // endsw 
+      fprintf(mPSFile, " ff %d FS ", FontSize) ; 
+    }
+    
+    
     fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) S gr\n", x, y, s) ; 
     setFontDone = true ; 
@@ -723,6 +773,6 @@
 
 void  PSFile::DrawLine    (double x1, double y1, double x2, double y2, 
-		   PIColors DrawColor,
-		   PILineAtt LineAtt) {
+			   PIColors DrawColor,
+			   PILineAtt LineAtt) {
 
   int lw = 0 ; 
Index: trunk/SophyaPI/PI/psfile.h
===================================================================
--- trunk/SophyaPI/PI/psfile.h	(revision 381)
+++ trunk/SophyaPI/PI/psfile.h	(revision 382)
@@ -25,5 +25,5 @@
 #endif
 #include "pisysdep.h"
-
+#include "pifontgen.h"
 
 #include "pigraphgen.h"      // Types enumeres repris de Peida:PIFontSize...
@@ -92,5 +92,5 @@
     virtual PIColors    GetFillColor();
     virtual PIFontAtt   GetFontAtt();
-    virtual PIFontSize  GetFontSize();
+    virtual int         GetFontSize();
     virtual PILineAtt   GetLineAtt();
     virtual PIMarker    GetMarker();
@@ -108,4 +108,5 @@
     virtual void  DrawString  (double x,  double y, const char *s, 
 			       PIColors DrawColor  = PI_NotDefColor, 
+			       PIFontName FontName = PI_DefaultFont,
 			       PIFontAtt FontAtt   = PI_NotDefFontAtt, 
 			       int FontSize        = 8);
@@ -196,5 +197,7 @@
     enum PIColors    mFillColor;  /* Couleur de remplissage courante */
     enum PIFontAtt   mFontAtt; 
-    enum PIFontSize  mFontSize; 
+    //    enum PIFontSize  mFontSize; 
+    int              mFontSize; 
+    enum PIFontName  mFontName; 
     enum PILineAtt   mLineAtt;    /* Epaisseur d une ligne */
     enum PIMarker    mMarker;     /* Marker courant */
