Changeset 1899 in Sophya for trunk/SophyaPI/PI/psfile.cc


Ignore:
Timestamp:
Feb 13, 2002, 12:03:15 PM (24 years ago)
Author:
ansari
Message:

Fin implementation trace texte vertical (PIGraphX, PIGraphPS, PSFile)
Debut de modification de gestion des Drawer (AutoDeleteOndetach, ...)

Reza 13/02/2002

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/psfile.cc

    r1898 r1899  
    946946      fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) S gr\n", x, y, s) ;
    947947    else {
     948      unsigned long txtdir = pos & PI_TextDirection;
    948949      int posh = pos & PI_HorizontalPosition;
    949950      int posv = pos & PI_VerticalPosition;
     951      int angle = 0;
     952      if (txtdir == PI_TextDirectionVerticalUp) angle = -90;
     953      else if (txtdir == PI_TextDirectionVerticalDown) angle = 90;
     954
    950955      if ((posh == PI_HorizontalLeft)  &&
    951           ((posv == PI_VerticalBaseLine) || (posv == 0)) )
    952         fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) hlshstr gr\n",
    953                 x, y, s) ;
     956          ((posv == PI_VerticalBaseLine) || (posv == 0)) ) {
     957        if (angle == 0)
     958          fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) hlshstr gr\n",
     959                  x, y, s) ;
     960        else
     961          fprintf(mPSFile, "gs %.2f Ux %.2f Uy m %d rotate (%s) hlshstr gr\n",
     962                  x, y, angle, s) ;
     963      }
    954964      else {
    955965        char ssvp = 'b';
     
    960970          else sshp = 'l';
    961971        }
    962         if (posv == 0)
    963           fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) h%cshstr gr\n",
    964                   x, y, s, sshp) ;
     972        if (posv == 0) {
     973          if (angle == 0)
     974            fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) h%cshstr gr\n",
     975                    x, y, s, sshp) ;
     976          else fprintf(mPSFile, "gs %.2f Ux %.2f Uy m %d rotate (%s) h%cshstr gr\n",
     977                       x, y, angle, s, sshp) ;
     978        }
    965979        else {
    966980          if (posv == PI_VerticalCenter)  ssvp = 'c';
     
    968982          else ssvp = 'b';
    969983        }
    970         fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) h%cv%cshstr gr\n",
     984        if (angle == 0)
     985          fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) h%cv%cshstr gr\n",
    971986                  x, y, s, sshp, ssvp) ;
     987        else
     988          fprintf(mPSFile, "gs %.2f Ux %.2f Uy m %d rotate (%s) h%cv%cshstr gr\n",
     989                  x, y, angle, s, sshp, ssvp) ;
    972990      }
    973991    }
Note: See TracChangeset for help on using the changeset viewer.