Index: /trunk/SophyaPI/PI/Tests/pist.cc
===================================================================
--- /trunk/SophyaPI/PI/Tests/pist.cc	(revision 1897)
+++ /trunk/SophyaPI/PI/Tests/pist.cc	(revision 1898)
@@ -48,4 +48,5 @@
                          int sx=10, int sy=10, int px=0, int py=0);
   virtual         ~StringPosDrawWdg();
+  inline void     SetTextDirection(PIGrTextDirection txtdir) { mTxtDir = txtdir; }
 
 // Traitement des evenements   
@@ -54,4 +55,5 @@
 
 protected:
+  PIGrTextDirection mTxtDir;  
 };
 
@@ -65,5 +67,4 @@
 				    int sx=10, int sy=10, int px=0, int py=0);
   virtual         ~CompStringDrawWdg();
-
 // Traitement des evenements   
 //  virtual void   Resize();
@@ -274,4 +275,5 @@
 
 {
+  mTxtDir = PI_TextDirectionHorizontal;
 }
 
@@ -331,4 +333,61 @@
 char * s1;
 
+if (mTxtDir != PI_TextDirectionHorizontal) {
+  xpos = 50;  ypos = 350;
+  s1 = "V_Top-H_Left-TxDUp";
+  g->SelForeground(PI_Red);
+  g->DrawLine(xpos-10, ypos, xpos+10, ypos); 
+  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
+  g->SelForeground(PI_Black);
+  g->DrawString(xpos, ypos, s1, 
+		PI_HorizontalLeft|PI_VerticalTop|PI_TextDirectionVerticalUp);  
+
+  xpos = 100;  ypos = 300;
+  s1 = "V_Top-H_Center-TxDUp";
+  g->SelForeground(PI_Red);
+  g->DrawLine(xpos-10, ypos, xpos+10, ypos); 
+  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
+  g->SelForeground(PI_Black);
+  g->DrawString(xpos, ypos, s1, 
+		PI_HorizontalCenter|PI_VerticalTop|PI_TextDirectionVerticalUp);
+
+  xpos = 150;  ypos = 250;
+  s1 = "V_Top-H_Right-TxDUp";
+  g->SelForeground(PI_Red);
+  g->DrawLine(xpos-10, ypos, xpos+10, ypos); 
+  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
+  g->SelForeground(PI_Black);
+  g->DrawString(xpos, ypos, s1, 
+		PI_HorizontalRight|PI_VerticalTop|PI_TextDirectionVerticalUp);
+
+  xpos = 200;  ypos = 50;
+  s1 = "V_Top-H_Left-TxDown";
+  g->SelForeground(PI_Red);
+  g->DrawLine(xpos-10, ypos, xpos+10, ypos); 
+  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
+  g->SelForeground(PI_Black);
+  g->DrawString(xpos, ypos, s1, 
+		PI_HorizontalLeft|PI_VerticalTop|PI_TextDirectionVerticalDown);  
+
+  xpos = 250;  ypos = 100;
+  s1 = "V_Top-H_Center-TxDown";
+  g->SelForeground(PI_Red);
+  g->DrawLine(xpos-10, ypos, xpos+10, ypos); 
+  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
+  g->SelForeground(PI_Black);
+  g->DrawString(xpos, ypos, s1, 
+		PI_HorizontalCenter|PI_VerticalTop|PI_TextDirectionVerticalDown);
+
+  xpos = 300;  ypos = 150;
+  s1 = "V_Top-H_Right-TxDown";
+  g->SelForeground(PI_Red);
+  g->DrawLine(xpos-10, ypos, xpos+10, ypos); 
+  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
+  g->SelForeground(PI_Black);
+  g->DrawString(xpos, ypos, s1, 
+		PI_HorizontalRight|PI_VerticalTop|PI_TextDirectionVerticalDown);
+
+  return;
+}
 // --------------- Vertical Top -----------------
 
@@ -350,5 +409,5 @@
 
 xpos = XSize()-30;  ypos = 75;
-s1 = "V_Top-H_Center";
+s1 = "V_Top-H_Right";
 g->SelForeground(PI_Red);
 g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
@@ -663,4 +722,6 @@
 m[0]->AppendItem("StringPosDrawWdg", 10102);
 m[0]->AppendItem("CompStringDrawWdg", 10103);
+m[0]->AppendItem("StringPosVertical", 10104);
+
 m[0]->AppendItem("->eps", 10111);
 m[0]->AppendItem("->ps", 10112);
@@ -751,4 +812,19 @@
       wp->SetAutoDelChilds(true);
       CompStringDrawWdg* exb  = new CompStringDrawWdg(wp, "compposdrawwdg", 600, 400, 0, 0);
+      exb->SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_elastic);
+      wp->SetUserData(exb);
+      wp->Show();
+      }
+    break;
+
+    case 10104: // Creation d'un StringPosDrawWdg-VerticalStringDir
+      {
+      nbwin++;
+      sprintf(strg, "Creation StringPosDrawWdg-Vertical   \n Fenetre No %d ", nbwin);
+      sprintf(strg,"StringPosDrawWdg-Vertical - %d", nbwin);
+      PIWindow* wp = new PIWindow(this, strg, PIWK_normal,  400, 600, 150, 150);
+      wp->SetAutoDelChilds(true);
+      StringPosDrawWdg* exb  = new StringPosDrawWdg(wp, "sposdrawwdgvert", 400, 600, 0, 0);
+      exb->SetTextDirection(PI_TextDirectionVerticalUp);
       exb->SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_elastic);
       wp->SetUserData(exb);
Index: /trunk/SophyaPI/PI/pigraphgen.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphgen.cc	(revision 1897)
+++ /trunk/SophyaPI/PI/pigraphgen.cc	(revision 1898)
@@ -172,5 +172,5 @@
 //--
 //++
-// void  DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0)
+// void  DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0)
 //	Trace la chaîne de caractères "s" à la position "x,y", 
 //	en utilisant la couleur d'avant-plan (Foreground)
@@ -194,5 +194,5 @@
 void 
 PIGraphicGen::DrawCompString(PIGrCoord x, PIGrCoord y, const char* s,
-			     const char* s_up, const char* s_dn, int pos)
+			     const char* s_up, const char* s_dn, unsigned long pos)
 {
   if ((s_up == NULL) && (s_dn == NULL)) {
@@ -567,5 +567,5 @@
 
 /* --Methode-- */
-bool PIGraphicGen::CalcStringPositionShift(char const* s, int pos, 
+bool PIGraphicGen::CalcStringPositionShift(char const* s, unsigned long pos, 
 					   int& dx, int& dy)
 {
Index: /trunk/SophyaPI/PI/pigraphgen.h
===================================================================
--- /trunk/SophyaPI/PI/pigraphgen.h	(revision 1897)
+++ /trunk/SophyaPI/PI/pigraphgen.h	(revision 1898)
@@ -51,4 +51,11 @@
        PI_VerticalCenter = 0x30, PI_VerticalTop = 0x40, 
        PI_VerticalPosition = 0xF0 };
+
+// Orientation de trace de chaines 
+enum PIGrTextDirection  
+     { PI_TextDirectionHorizontal = 0, 
+       PI_TextDirectionVerticalUp = 0x100,
+       PI_TextDirectionVerticalDown = 0x200,
+       PI_TextDirection = 0xF00};
 
 // Les differents modes de trace graphique disponible
@@ -154,8 +161,8 @@
   virtual void       Erase(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy)     = 0;
 
-  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0)        = 0;
-  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0)  = 0;
+  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0) = 0;
+  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0) = 0;
   virtual void       DrawCompString(PIGrCoord x, PIGrCoord y, const char* s, 
-                                    const char* s_up, const char* s_dn, int pos = 0);
+                                    const char* s_up, const char* s_dn, unsigned long pos = 0);
 
   virtual void       DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)  = 0;
@@ -217,5 +224,5 @@
   virtual PIGrCoord  GetFontHeight(PIGrCoord& asc, PIGrCoord& desc);
   virtual PIGrCoord  CalcStringWidth(char const* s);
-  virtual bool       CalcStringPositionShift(char const* s, int pos,  
+  virtual bool       CalcStringPositionShift(char const* s, unsigned long pos,  
 					     int& dx, int& dy);
 
Index: /trunk/SophyaPI/PI/pigraphps.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphps.cc	(revision 1897)
+++ /trunk/SophyaPI/PI/pigraphps.cc	(revision 1898)
@@ -112,5 +112,5 @@
 
 /* --Methode-- */
-void PIGraphicPS::DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
+void PIGraphicPS::DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
 {
 if(mPSOut) {
@@ -128,5 +128,5 @@
 
 /* --Methode-- */
-void PIGraphicPS::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
+void PIGraphicPS::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
 {
 if(mPSOut) {
Index: /trunk/SophyaPI/PI/pigraphps.h
===================================================================
--- /trunk/SophyaPI/PI/pigraphps.h	(revision 1897)
+++ /trunk/SophyaPI/PI/pigraphps.h	(revision 1898)
@@ -21,6 +21,6 @@
 //  Trace graphiques
   virtual void       Erase(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
-  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
-  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
+  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
+  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
   virtual void       DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2);
   virtual void       DrawBox(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
Index: /trunk/SophyaPI/PI/pigraphuc.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphuc.cc	(revision 1897)
+++ /trunk/SophyaPI/PI/pigraphuc.cc	(revision 1898)
@@ -392,5 +392,5 @@
 
 /* --Methode-- */
-void PIGraphicUC::DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
+void PIGraphicUC::DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
 {
   if (!mGrC) return;
@@ -401,5 +401,5 @@
 
 /* --Methode-- */
-void PIGraphicUC::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
+void PIGraphicUC::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
 {
   if (!mGrC) return;
@@ -411,5 +411,5 @@
 /* --Methode-- */
 void PIGraphicUC::DrawCompString(PIGrCoord x, PIGrCoord y, const char* s, 
-				 const char* s_up, const char* s_dn, int pos)
+				 const char* s_up, const char* s_dn, unsigned long pos)
 {
   if (!mGrC) return;
Index: /trunk/SophyaPI/PI/pigraphuc.h
===================================================================
--- /trunk/SophyaPI/PI/pigraphuc.h	(revision 1897)
+++ /trunk/SophyaPI/PI/pigraphuc.h	(revision 1898)
@@ -43,8 +43,8 @@
 //  Trace graphiques
   virtual void       Erase(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
-  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
-  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
+  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
+  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
   virtual void       DrawCompString(PIGrCoord x, PIGrCoord y, const char* s, 
-                                    const char* s_up, const char* s_dn, int pos = 0);
+                                    const char* s_up, const char* s_dn, unsigned long pos = 0);
   virtual void       DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2);
   virtual void       DrawBox(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
Index: /trunk/SophyaPI/PI/pigraphx.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphx.cc	(revision 1897)
+++ /trunk/SophyaPI/PI/pigraphx.cc	(revision 1898)
@@ -8,4 +8,5 @@
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
+#include <X11/Xutil.h>
 
 #include "pigraphx.h"
@@ -108,24 +109,38 @@
 
 /* --Methode-- */
-void PIGraphicX::DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
+void PIGraphicX::DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
 {
 int dx, dy, xi, yi;
 xi = x;  yi = y;
-if (CalcStringPositionShift(s, pos, dx, dy)) {
-  xi -= dx;  yi -= dy; }
-XDrawString (XtDisplay (MyWdg()),mWId, 
-                  DefGC(), xi, yi, s, strlen(s));
-return;
-}
-
-/* --Methode-- */
-void PIGraphicX::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
+bool fgcsps = CalcStringPositionShift(s, pos, dx, dy);
+unsigned long txtdir = pos&PI_TextDirection;
+if (txtdir == PI_TextDirectionHorizontal) {
+  if (fgcsps) { xi -= dx;  yi -= dy; }
+  XDrawString (mDisp, mWId, DefGC(), xi, yi, s, strlen(s));
+}
+else { 
+  if (txtdir == PI_TextDirectionVerticalDown) { xi += dy; yi -= dx; }
+  else {   xi -= dy; yi += dx; }
+  DrawVerticalString(xi, yi, s, txtdir, false);
+}
+return;
+}
+
+/* --Methode-- */
+void PIGraphicX::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
 {
 int dx, dy, xi, yi;
 xi = x;  yi = y;
-if (CalcStringPositionShift(s, pos, dx, dy)) {
-  xi -= dx;  yi -= dy; }
-XDrawImageString (XtDisplay (MyWdg()),mWId, 
-                  DefGC(), xi, yi, s, strlen(s));
+bool fgcsps = CalcStringPositionShift(s, pos, dx, dy);
+unsigned long txtdir = pos&PI_TextDirection;
+if (txtdir == PI_TextDirectionHorizontal) {
+  if (fgcsps) { xi -= dx;  yi -= dy; }
+  XDrawImageString (mDisp, mWId, DefGC(), xi, yi, s, strlen(s));
+}
+else { 
+  if (txtdir == PI_TextDirectionVerticalDown) { xi += dy; yi -= dx; }
+  else {   xi -= dy; yi += dx; }
+  DrawVerticalString(xi, yi, s, txtdir, true);
+}
 return;
 }
@@ -135,5 +150,5 @@
 void PIGraphicX::DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)
 {
-XDrawLine(XtDisplay (MyWdg()), mWId, DefGC(), (int)x1, (int)y1, (int)x2, (int)y2);
+XDrawLine(mDisp, mWId, DefGC(), (int)x1, (int)y1, (int)x2, (int)y2);
 return;
 }
@@ -149,5 +164,5 @@
 if (idx < 0)  { ix0 += idx;  idx = -idx; }
 if (idy < 0)  { iy0 += idy;  idy = -idy; }
-XDrawRectangle(XtDisplay (MyWdg()), mWId, 
+XDrawRectangle(mDisp, mWId, 
                DefGC(), ix0, iy0, idx, idy);
 return;
@@ -163,5 +178,5 @@
 if (idx < 0)  { ix0 += idx;  idx = -idx; }
 if (idy < 0)  { iy0 += idy;  idy = -idy; }
-XFillRectangle(XtDisplay (MyWdg()), mWId, 
+XFillRectangle(mDisp, mWId, 
                DefGC(), ix0, iy0, idx, idy);
 return;
@@ -171,5 +186,5 @@
 void PIGraphicX::DrawCircle(PIGrCoord x0, PIGrCoord y0, PIGrCoord r)
 {
-XDrawArc(XtDisplay (MyWdg()), mWId, DefGC(),
+XDrawArc(mDisp, mWId, DefGC(),
          (int)x0-(int)r, (int)y0-(int)r, 2*(int)r, 2*(int)r, 0, 360*64);
 return;
@@ -179,5 +194,5 @@
 void PIGraphicX::DrawFCircle(PIGrCoord x0, PIGrCoord y0, PIGrCoord r)
 {
-XFillArc(XtDisplay (MyWdg()), mWId, DefGC(),
+XFillArc(mDisp, mWId, DefGC(),
          (int)x0-(int)r, (int)y0-(int)r, 2*(int)r, 2*(int)r, 0, 360*64);
 return;
@@ -187,5 +202,5 @@
 void PIGraphicX::DrawOval(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy)
 {
-XDrawArc(XtDisplay (MyWdg()), mWId, DefGC(),
+XDrawArc(mDisp, mWId, DefGC(),
          (int)x0, (int)y0, (int)dx, (int)dy, 0, 360*64);
 return;
@@ -195,5 +210,5 @@
 void PIGraphicX::DrawFOval(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy)
 {
-XFillArc(XtDisplay (MyWdg()), mWId, DefGC(),
+XFillArc(mDisp, mWId, DefGC(),
          (int)x0, (int)y0, (int)dx, (int)dy, 0, 360*64);
 return;
@@ -236,5 +251,5 @@
 int mode = CoordModeOrigin;
 if (cinc) mode =  CoordModePrevious;
-XFillPolygon(XtDisplay (MyWdg()), mWId, DefGC(), pxp, n, 
+XFillPolygon(mDisp, mWId, DefGC(), pxp, n, 
                         Complex, mode);
 if (n > NMXXPOINTS)  delete[] pxp;
@@ -248,5 +263,5 @@
                          double degdeb, double degfin)
 {
-XDrawArc(XtDisplay (MyWdg()), mWId, DefGC(),
+XDrawArc(mDisp, mWId, DefGC(),
          (int)x0, (int)y0, (int)dx, (int)dy, (int)(degdeb*64.), (int)(degfin*64.));
 return;
@@ -257,5 +272,5 @@
                          double degdeb, double degfin)
 {
-XFillArc(XtDisplay (MyWdg()), mWId, DefGC(),
+XFillArc(mDisp, mWId, DefGC(),
          (int)x0, (int)y0, (int)dx, (int)dy, (int)(degdeb*64.), (int)(degfin*64.));
 return;
@@ -284,14 +299,14 @@
       x1 = (float)x0-hmsz;   y1 = y0;
       x2 = (float)x0+dmsz;   y2 = y1;
-      XDrawLine(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, x2, y2);
+      XDrawLine(mDisp, mWId, mMrkGC, x1, y1, x2, y2);
       x1 = x0;  y1 = (float)y0-hmsz;
       x2 = x1;  y2 = (float)y0+dmsz;
-      XDrawLine(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, x2, y2);
+      XDrawLine(mDisp, mWId, mMrkGC, x1, y1, x2, y2);
       break;
     case  PI_CrossMarker :
       x1 = (float)x0-hmsz;   y1 = (float)y0-hmsz;
       x2 = (float)x0+dmsz;   y2 = (float)y0+dmsz;
-      XDrawLine(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, x2, y2);
-      XDrawLine(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y2, x2, y1);
+      XDrawLine(mDisp, mWId, mMrkGC, x1, y1, x2, y2);
+      XDrawLine(mDisp, mWId, mMrkGC, x1, y2, x2, y1);
       break;  
     case PI_CircleMarker :
@@ -300,6 +315,6 @@
       x1 = (int)x0-r;  y1 = (int)y0-r;
       if (mMrk == PI_CircleMarker) 
-	XDrawArc(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, 2*r, 2*r, 0, 360*64);
-      else XFillArc(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, 2*r, 2*r, 0, 360*64);
+	XDrawArc(mDisp, mWId, mMrkGC, x1, y1, 2*r, 2*r, 0, 360*64);
+      else XFillArc(mDisp, mWId, mMrkGC, x1, y1, 2*r, 2*r, 0, 360*64);
       break;
     case PI_BoxMarker :
@@ -432,5 +447,5 @@
 int mode = CoordModeOrigin;
 if (cinc) mode =  CoordModePrevious;
-XFillPolygon(XtDisplay (MyWdg()), mWId, mMrkGC, pxp, n, 
+XFillPolygon(mDisp, mWId, mMrkGC, pxp, n, 
                         Complex, mode);
 return;
@@ -438,4 +453,63 @@
 
 
+/* --Methode-- */
+void PIGraphicX::DrawVerticalString(int x, int y, const char* s, unsigned long pos, bool imgs)
+{
+  int fh, fasc, fdes;
+  fh = GetFont().GetFontHeight(fasc, fdes); 
+  int sw = GetFont().GetStringWidth(s);
+
+  Display * dsx = mDisp;
+  Window rw = DefaultRootWindow(dsx);
+  Pixmap pxm = XCreatePixmap(dsx, rw, sw, fh, 1 );
+
+  XGCValues  xgv;
+  xgv.function = GXcopy;
+  xgv.plane_mask = ~0;
+  GC gcbm = XCreateGC (dsx, pxm, GCFunction | GCPlaneMask, &xgv);
+  XSetForeground(dsx, gcbm, ~0); 
+  XSetBackground(dsx, gcbm, 0);
+  XSetFont(mDisp, gcbm, myFont.GetXFontId());
+  
+  XDrawImageString (dsx, pxm, gcbm, 0, fasc, s, strlen(s));
+  XImage* ximg = XGetImage(dsx, pxm, 0, 0, sw, fh, 0xFFFFFFFF, ZPixmap);
+
+  Pixmap pxm2 = XCreatePixmap(dsx, rw, fh, sw, 1 );
+  XImage* ximg2 =  XGetImage(dsx, pxm2, 0, 0, fh, sw, 0xFFFFFFFF, ZPixmap);
+  //  On recopie de ximg -> ximg2 en echangeant x,y
+  int i,j;
+  bool fgdown = ((pos&PI_TextDirection) == PI_TextDirectionVerticalDown);
+  if (fgdown) {
+    for(i=0; i<sw; i++)
+      for(j=0; j<fh; j++)
+	XPutPixel(ximg2, fh-j-1, i, XGetPixel(ximg, i, j));
+  }
+  else {
+    for(i=0; i<sw; i++)
+      for(j=0; j<fh; j++)
+	XPutPixel(ximg2, j, sw-i-1, XGetPixel(ximg, i, j));
+  }
+  XPutImage(dsx, pxm2, gcbm, ximg2, 0, 0, 0, 0, fh, sw);
+  GC gcvs = XCreateGC (dsx, mWId, GCFunction | GCPlaneMask, &xgv);
+  XCopyGC(dsx, DefGC(), ~0, gcvs); 
+  XSetStipple(dsx, gcvs, pxm2);
+  XSetFillStyle(dsx, gcvs, FillStippled);
+  if (fgdown) {
+    XSetTSOrigin(dsx, gcvs, x, y);
+    XFillRectangle(dsx, mWId, gcvs, x, y, fh, sw);
+  }
+  else {
+    XSetTSOrigin(dsx, gcvs, x-fh, y-sw);
+    XFillRectangle(dsx, mWId, gcvs, x-fh, y-sw, fh, sw);
+  }
+  // Cleaning  
+  XDestroyImage(ximg);
+  XDestroyImage(ximg2);
+  XFreeGC(dsx, gcvs);
+  XFreeGC(dsx, gcbm);
+  XFreePixmap(dsx, pxm);			     
+  XFreePixmap(dsx, pxm2);			     
+  
+}
 
 
Index: /trunk/SophyaPI/PI/pigraphx.h
===================================================================
--- /trunk/SophyaPI/PI/pigraphx.h	(revision 1897)
+++ /trunk/SophyaPI/PI/pigraphx.h	(revision 1898)
@@ -21,6 +21,6 @@
 //  Trace graphiques
   virtual void       Erase(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
-  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
-  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
+  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
+  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
   virtual void       DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2);
   virtual void       DrawBox(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
@@ -94,4 +94,5 @@
   void           MrkDrawPolygon(XPoint* pxp, int n, bool cinc);
   void           MrkDrawFPolygon(XPoint* pxp, int n, bool cinc);
+  void	         DrawVerticalString(int x, int y, const char* s, unsigned long pos, bool imgs=false);
 
 //  Structure et identificateur XWindow  associe
Index: /trunk/SophyaPI/PI/psfile.cc
===================================================================
--- /trunk/SophyaPI/PI/psfile.cc	(revision 1897)
+++ /trunk/SophyaPI/PI/psfile.cc	(revision 1898)
@@ -877,5 +877,5 @@
 			   PIFontAtt FontAtt, 
 			   int FontSize, 
-			   int pos) {
+			   unsigned long pos) {
     bool change = false;
 
Index: /trunk/SophyaPI/PI/psfile.h
===================================================================
--- /trunk/SophyaPI/PI/psfile.h	(revision 1897)
+++ /trunk/SophyaPI/PI/psfile.h	(revision 1898)
@@ -116,5 +116,5 @@
 			       PIFontAtt FontAtt   = PI_NotDefFontAtt, 
 			       int FontSize        = 8, 
-			       int pos = 0);
+			       unsigned long pos = 0);
     virtual void  DrawLine    (double x1, double y1, double x2, double y2, 
 			       PIColors DrawColor  = PI_NotDefColor,
