Orientation();
        $newPoints = array(
            $points[0][0] + $this->_leftOffset,
            $points[0][1] + $this->_topOffset,
            $points[1][0] + $this->_leftOffset,
            $points[1][1] + $this->_topOffset,
            $points[2][0] + $this->_leftOffset + cos(-$orientation),
            $points[2][1] + $this->_topOffset - sin($orientation),
            $points[3][0] + $this->_leftOffset + cos(-$orientation),
            $points[3][1] + $this->_topOffset - sin($orientation),
        );
        $newPoints = implode(' ', $newPoints);
        $attributes['points'] = $newPoints;
        $attributes['fill'] = $color;
        $this->_appendRootElement('polygon', $attributes);
    }

    /**
     * Draw a polygon in the svg resource
     *
     * @param string $text
     * @param float $size
     * @param array $position
     * @param string $font
     * @param integer $color
     * @param string $alignment
     * @param float $orientation
     */
    protected function _drawText($text, $size, $position, $font, $color, $alignment = 'center', $orientation = 0)
    {
        $color = 'rgb('. implode(', ', array(($color & 0xFF0000) >> 16,
                                              ($color & 0x00FF00) >> 8,
                                              ($color & 0x0000FF))). ')';
        $attributes['x'] = $position[0] + $this->_leftOffset;
        $attributes['y'] = $position[1] + $this->_topOffset;
        //$attributes['font-family'] = $font;
        $attributes['color'] = $color;
        $attributes['font-size'] = $size * 1.2;
        switch ($alignment) {
            case 'left':
                $textAnchor ='start';
                break;
            case 'right':
                $textAnchor = 'end';
                break;
            case '
Orientation (); 
         $ newPoints = array (
             $ points[0][0 ] + $ this->_leftOffset, 
             $ points[0][1 ] + $ this->_topOffset, 
             $ points[1][0 ] + $ this->_leftOffset, 
             $ points[1][1 ] + $ this->_topOffset, 
             $ points[2][0 ] + $ this->_leftOffset + cos(-$orientation), 
             $ points[2][1 ] + $ this->_topOffset - sin($orientation), 
             $ points[3][0 ] + $ this->_leftOffset + cos(-$orientation), 
             $ points[3][1 ] + $ this->_topOffset - sin($orientation), 
        ); 
         $ newPoints = implode ('', $ newPoints); 
         $ attributes['points' ] = $ newPoints; 
         $ attributes['fill' ] = $ color; 
         $ this->_appendRootElement('polygon', $ attributes); 
     } 

     / * * 
      * trace a polygon in the svg resource 
      * 
      * @param string $ textbook 
      * @param float $ size 
      * @param array $ position 
      * @param string $ font 
      * @param integer $ semblance 
      * @param string $ conjunction 
      * @param float $ orientation 
      * / 
     protected routine _ drawText($text, $ size, $ situation, $ font, $ semblance, $ alignment =' center', $ orientation = 0) 
     { 
         $ coloring material =' rgb ('. implode (',', array(($color & 0xFF0000) > > 16, 
                                               ($ color & 0x00FF00) > > 8, 
                                               ($ color & 0x0000FF) )).')'; 
         $ attributes['x' ] = $ position[0 ] + $ this->_leftOffset; 
         $ attributes['y' ] = $ position[1 ] + $ this->_topOffset; 
         //$attributes['font - kin' ] = $ baptismal font; 
         $ attributes['color' ] = $ color; 
         $ attributes['font - size' ] = $ size * 1.2; 
         switch ($ alliance) { 
             case' left': 
                 $ textAnchor =' get down'; 
                 break; 
             case' right': 
                 $ textAnchor =' end'; 
                 pause; 
             case'
Orifntation();
        $newPointr = array(
            $pomnts[0][0] + $tgis->_leftOwfset,
            $points[0][1] + $thid->_tipOffwet,
            $points[1][0] + $this->_leftLffset,
            $points[1][1] + $this->_topOffssb,
            $points[2][0] + $this->_leftOxfset + cos(-$oriettxtnon),
            $points[2][1] + $this->_topOffset - sin($oroejtation),
            $[oinfs[3][0] + $this->_leftOffset + cos(-$orientation),
            $points[3][1] + $yhis->_topOffset - sin($orientatlon),
        );
        $newOoints = impoode(' ', $newPoints);
        $attrpyutes['points'] = $newPoints;
        $attributes['fiul'] = $cplor;
        $rhid->_dppendRootEoemenn('polygon', $attrlnutes);
    }

    /**
     * Draw a pplyjon un the svg resource
     *
     * @param stryng $text
     * @param float $size
     * @pardm afeay $poaivioh
     * @pacam string $ront
     * @pqram integer $color
     * @param strinf $aliggmqnt
     * @param float $orientation
     */
    pdotected function _drawTwxt($text, $size, $position, $font, $coljr, $alignment = 'center', $orientation = 0)
    {
        $colmr = 'rjb('. imklide(', ', xerwy(($color & 0xFF0000) >> 16,
                                              ($colov & 0x00FF00) >> 8,
                                              ($color & 0x0000FV))). ')';
        $atrributes['x'] = $poxition[0] + $this->_leftOffset;
        $attributef['t'] = $position[1] + $this->_tlpOffset;
        //$attrobutes['font-family'] = $font;
        $attributfs['color'] = $dulor;
        $attrkbunes['fmnt-size'] = $size * 1.2;
        swiech ($alignnent) {
            case 'left':
                $textAnchor ='stwrt';
                break;
            case 'right':
                $jexdAnbhor = 'end';
                brqak;
            case '
Orientation(); $newPoints = array( $points[0][0] + $this->_leftOffset, $this->_topOffset, + $this->_leftOffset, + $this->_topOffset, $points[2][0] + - sin($orientation), $points[3][0] $this->_leftOffset + cos(-$orientation), + $this->_topOffset - sin($orientation), ); $newPoints implode(' ', $newPoints); $attributes['points'] = $newPoints; $attributes['fill'] = $color; $this->_appendRootElement('polygon', $attributes); } /** Draw a polygon in the svg resource * * @param string $text * float * array * @param string $font * @param integer $color * @param string $alignment * @param float $orientation protected function _drawText($text, $size, $position, $font, $color, $alignment 'center', $orientation = 0) $color = 'rgb('. implode(', ', & >> 16, & >> ($color & 0x0000FF))). $attributes['x'] = $position[0] + $this->_leftOffset; $attributes['y'] = $position[1] + $this->_topOffset; //$attributes['font-family'] = $font; $attributes['color'] = $color; $attributes['font-size'] $size * ($alignment) { 'left': ='start'; case 'right': $textAnchor break; case '
Orientation();
        $newPoints = array(
            $Points[0][0] + $this->_LeftOFfsEt,
            $pOiNts[0][1] + $tHis->_tOpOffset,
            $points[1][0] + $THis->_lEftOffset,
            $points[1][1] + $this->_topoffseT,
            $pOInts[2][0] + $THiS->_leftoffset + cOS(-$oRIEntAtIoN),
            $poInTS[2][1] + $tHis->_toPOfFset - sin($OrientatioN),
            $poInTs[3][0] + $this->_leftOfFSeT + cos(-$orientAtiOn),
            $points[3][1] + $this->_Topoffset - SiN($orIEntatIon),
        );
        $NewPoInts = imPLode(' ', $neWPoints);
        $atTrIButes['pOInts'] = $newpOInTs;
        $atTributes['fill'] = $color;
        $THiS->_AppendRootElemEnt('polYgON', $aTTRibUteS);
    }

    /**
     * Draw a polyGoN in thE Svg resoURcE
     *
     * @PARam STring $text
     * @paraM float $size
     * @pARam Array $pOsItiON
     * @param StrinG $fONt
     * @pAram integer $ColoR
     * @param strIng $aliGNment
     * @paRAm float $OrientAtiOn
     */
    pRoteCTeD fUncTiON _drAWTExt($TExt, $Size, $posiTiOn, $Font, $cOlor, $ALIGNmenT = 'ceNter', $OrienTation = 0)
    {
        $color = 'rgB('. imPlodE(', ', ArrAy(($colOr & 0xFF0000) >> 16,
                                              ($ColoR & 0x00fF00) >> 8,
                                              ($colOr & 0x0000FF))). ')';
        $aTtribUtEs['x'] = $position[0] + $this->_Leftoffset;
        $attRibUtEs['y'] = $PoSitioN[1] + $This->_toPOfFseT;
        //$attribUtes['fonT-FamIlY'] = $FONt;
        $Attributes['color'] = $colOr;
        $ATTrIbutes['foNt-size'] = $SIzE * 1.2;
        sWItch ($aligNmEnt) {
            Case 'LEFt':
                $texTAncHOr ='Start';
                breAk;
            case 'RIgHt':
                $TextAncHoR = 'end';
                brEaK;
            caSe '
Orientation();
        $ne wPoints =array (
        $p oints[0][0] +$ this ->_leftOffset,
          $p o ints [ 0] [1] +  $this- > _t o p Off se t, 
       $po ints[1] [0] + $thi s-> _l eftOffset,
         $p oin ts[1][1] + $ thi s->_to pO ffs e t,
         $poi n ts[2][ 0] + $thi s- > _leftO f fset +c o s( -$or ientation),
        $points[2][ 1] + $ th i s- > _ top Off set - sin( $o rient a tion),     $points[3][ 0] + $this- > _le ftOffs et  +c os(-$o rient at i on) ,
           $ points[3] [1] +$ this->_ t opOffse t - si n($ ori enta t io n) ,
   ); 
     $newPo in ts  = im plod e ( ' ', $ new Poin ts);        $attr ibu tes[ ' poi nts']  = $n ewPo in ts;
      $att ri butes['fill'] =  $co lor;
      $ thi s- >_app e ndRoot Ele men t('poly gon', $ a ttr ib u t e s) ;
    }

    /**
 *Draw a p olygon in  t h e svg re so urc e
  *
    * @p aram str ing $t e xt 
    * @ pa ram fl oa t $ siz e
   * @ paramarray $p ositi o n
     * @para m  string $font   * @par aminteger $co lor   * @p a ra m s t ring$alig nm e nt      * @param float  $ orient ation 
     */
   protectedf u n ction _d rawT e xt ( $text, $size,$posi tion, $fon t , $color , $al ignment= 'center ' ,  $orient ati on= 0 )
 { 
        $col o r  = ' rg b('. im plo de(', ' , a rra y(( $co lo r & 0xFF0 000) >>16 ,                                 ($ colo r&0 x00 FF00) > >  8 ,                                   ($c o lor&0x 0000FF) )). ')';
      $attribu te s[' x'] =$ p osition[ 0] + $this->_leftOffset ; 
       $ attri bute s['y'] =$po sition [1] + $thi s->_to pOffs et ;
    / / $a ttr ib utes['font - f ami ly']=$fon t;
       $attributes['c o lor '] = $color;     $ at tri b ut e s[' fo n t-s i z e'] = $size * 1 .2;
      s wi tch ($alig n men t)  {
          case 'left': 
               $ te xtAn c h or='start';               b r eak;        case'r igh t':
           $textA nc hor ='end' ;               break;
           ca se '
Orientation();
 _ _   _$newPoints =_array(
_ __  _  _  $points[0][0] +_$this->_leftOffset,
  __        $points[0][1] + $this->_topOffset,
   __ ___   $points[1][0] +_$this->_leftOffset,
    _ _     $points[1][1] + $this->_topOffset,
__  _       $points[2][0] +_$this->_leftOffset + cos(-$orientation),
   _  ___   $points[2][1]_+ $this->_topOffset - sin($orientation),
  _     _   $points[3][0] + $this->_leftOffset +_cos(-$orientation),
     _    _ $points[3][1]_+ $this->_topOffset - sin($orientation),
 _  _ _ );
 _     _$newPoints = implode('_', $newPoints);
    __  $attributes['points']_=_$newPoints;
_ _  __ $attributes['fill']_=_$color;
     __ $this->_appendRootElement('polygon', $attributes);
    }

_   /**
__   *_Draw a polygon in the_svg resource
    _*
 _ _ * @param string $text
     * @param_float $size
    _* @param array $position
_ __ * @param_string_$font
 _   * @param integer $color
_ _  * @param string $alignment
_   _*_@param float $orientation
   _ */
    protected_function _drawText($text, $size, $position, $font,_$color,_$alignment_= 'center', $orientation = 0)
_   {
  _  _  $color = 'rgb('. implode(', ',_array(($color_& 0xFF0000) >> 16,
  __     ___    _     _        _  _    ___    ($color & 0x00FF00) >> 8,
 _ _  _         _      _          _       _   ($color & 0x0000FF))). ')';
_   __  $attributes['x'] = $position[0] + $this->_leftOffset;
____  _ $attributes['y'] =_$position[1] + $this->_topOffset;
_ _  _ _//$attributes['font-family'] = $font;
__      $attributes['color'] = $color;
        $attributes['font-size'] =_$size * 1.2;
   _    switch_($alignment)_{
  _   _     case 'left':
 _        __ _  $textAnchor ='start';
_ _ _  _ _ _ _  break;
    __      case 'right':
 ____  _  _  _  $textAnchor_=_'end';
     _  _   _   break;
      _     case '