Ejemplo n.º 1
0
 function Run()
 {
     $leftm = 1.5;
     // Left margin (for table schemes)
     $topm = 5;
     // Top margin (for table schemes)
     $tblwidth = 15;
     // Individual table width
     $tlo = 1;
     // Offset for top line
     // Add the background color for the project specific tables
     $this->ishape->IndentedRectangle($leftm, $topm - 1, 3 * $tblwidth + $tlo + 6, 45, $tlo + 2 * $tblwidth + 2, 30, CORNER_BOTTOMLEFT, 'lightblue');
     // Stroke the tables (series of x,y offsets, If =-1 then use the
     // automtic positioning
     $tblposadj = array($tlo, 0, $tblwidth + $tlo + 2, 0, 2 * $tblwidth + $tlo + 4, 0, -1, 16, -1, 16);
     $dbschema = new ImgDBSchema('jpgraph_doc', 'FormatTblName', 'FormatFldName');
     $dbschema->SetMargin($leftm, $topm);
     $dbschema->SetTableWidth($tblwidth);
     $dbschema->Stroke($this->img, $this->iscale, $tblposadj);
     $tt = new CanvasRectangleText();
     $tt->SetFillColor('');
     $tt->SetColor('');
     $tt->SetFontColor('navy');
     // Add explanation
     $tt->SetFont(FF_ARIAL, FS_NORMAL, 12);
     $tt->Set('Project specific tables', $tblwidth + $leftm + 3, 16, 15);
     $tt->Stroke($this->img, $this->iscale);
     // Add title
     $tt->SetColor('');
     $tt->SetFont(FF_VERDANA, FS_BOLD, 26);
     $tt->Set('DDDA - DB Schema', 9, 0.5, 30);
     $tt->Stroke($this->img, $this->iscale);
     // Add a version and date
     $tt->SetFillColor('yellow');
     $tt->SetFont(FF_FONT1, FS_NORMAL, 10);
     $tt->Set("Generated: " . date("ymd H:i", time()), 1, $this->iymax * 0.96, 15);
     $tt->Stroke($this->img, $this->iscale);
     $this->ig->Stroke();
 }
$tt->SetColor('');
$tt->SetFontColor('navy');
$t = new CanvasRectangleText();
$t->SetFont(FF_ARIAL, FS_NORMAL, 14);
$t->SetFillColor('goldenrod1');
$t->SetFontColor('navy');
// Now start drawing the arch overview from the bottom and up
// This is all pretty manual and one day I will write a proper
// framework to make it easy to construct these types of architecture
// overviews. But for now, just plain old coordinates..
// Line: GD Library and image libraries
$h = 3;
$s = 3;
$d = $l + $width - 9;
$t->SetFillColor('cadetblue3');
$t->Set("TTF", $d, $r + 2, $s, 1);
$t->Stroke($g->img, $scale);
$t->Set("PNG", $d + $s, $r + 2, $s, 1);
$t->Stroke($g->img, $scale);
$t->Set("JPEG", $d + 2 * $s, $r + 2, $s, 1);
$t->Stroke($g->img, $scale);
$shape->IndentedRectangle($l, $r, $width, $h, $s * 3, 1, 2, 'lightgreen');
$tt->Set("GD Basic library\n(1.8.x or 2.x)", $l, $r, $width, $h - 1);
$tt->Stroke($g->img, $scale);
// Area: Basic internal JpGraph architecture
$t->SetFillColor('goldenrod1');
$h = 2;
$r -= $h;
$d = 8;
$t->Set("Image primitives\n(RGB, Anti-aliasing,\nGD Abstraction)", $l, $r - 0.5, $width * 0.5, $h + 0.5);
$t->Stroke($g->img, $scale);
Ejemplo n.º 3
0
$g->SetColor('white');
$g->SetMarginColor("teal");
$g->InitFrame();
$t = new CanvasRectangleText();
$t->SetFillColor('lightgreen');
$t->SetFontColor('navy');
$t->SetFont(FF_ARIAL, FS_NORMAL, 16);
$t->Set("\n\n\n\n\n\n\n\n\n\n\nTTF Fonts", 0.5, 19, 26, 32);
$t->Stroke($g->img, $scale);
$t = new CanvasRectangleText();
$t->SetFillColor('');
$t->SetFontColor('black');
$t->SetColor('');
$t->SetShadow('');
$t->SetFont(FF_ARIAL, FS_BOLD, 18);
$t->Set('Family', 1, 1, 8);
$t->Stroke($g->img, $scale);
$t->Set('Italic style', 9, 1, 8);
$t->Stroke($g->img, $scale);
$t->Set('Bold style', 17.5, 1, 8);
$t->Stroke($g->img, $scale);
$t->SetFillColor('yellow');
$t->SetFontColor('black');
$t->SetColor('black');
$t->SetShadow('gray');
$r = 6;
$c = 1;
$w = 7.5;
$h = 3.5;
$fonts = array(array("Font 0", FF_FONT0, FS_NORMAL), array("", FF_FONT0, FS_ITALIC), array("", FF_FONT0, FS_BOLD), array("Font 1", FF_FONT1, FS_NORMAL), array("", FF_FONT1, FS_ITALIC), array("Font 1 bold", FF_FONT1, FS_BOLD), array("Font 2", FF_FONT2, FS_NORMAL), array("", FF_FONT2, FS_ITALIC), array("Font 2 bold", FF_FONT2, FS_BOLD), array("Arial", FF_ARIAL, FS_NORMAL), array("Arial italic", FF_ARIAL, FS_ITALIC), array("Arial bold", FF_ARIAL, FS_BOLD), array("Verdana", FF_VERDANA, FS_NORMAL), array("Verdana italic", FF_VERDANA, FS_ITALIC), array("Verdana bold", FF_VERDANA, FS_BOLD), array("Trebuche", FF_TREBUCHE, FS_NORMAL), array("Trebuche italic", FF_TREBUCHE, FS_ITALIC), array("Trebuche bold", FF_TREBUCHE, FS_BOLD), array("Georgia", FF_GEORGIA, FS_NORMAL), array("Georgia italic", FF_GEORGIA, FS_ITALIC), array("Georgia bold", FF_GEORGIA, FS_BOLD), array("Comic", FF_COMIC, FS_NORMAL), array("", FF_COMIC, FS_ITALIC), array("Comic bold", FF_COMIC, FS_BOLD), array("Courier", FF_COURIER, FS_NORMAL), array("Courier italic", FF_COURIER, FS_ITALIC), array("Courier bold", FF_COURIER, FS_BOLD), array("Times normal", FF_TIMES, FS_NORMAL), array("Times italic", FF_TIMES, FS_ITALIC), array("Times bold italic", FF_TIMES, FS_BOLDITALIC));
$n = count($fonts);
Ejemplo n.º 4
0
$t = new CanvasRectangleText();
$t->SetFont(FF_ARIAL, FS_NORMAL, 16);
$t->SetFillColor('lemonchiffon2');
$t->SetFontColor('black');
$t->Set("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTTF Fonts (11pt)", 0.5, 19.5, 26, 64.5);
$t->Stroke($g->img, $scale);
$t->SetFillColor('lemonchiffon3');
$t->Set("\n\n\n\nBitmap Fonts", 0.5, 5, 26, 13.5);
$t->Stroke($g->img, $scale);
$t = new CanvasRectangleText();
$t->SetFillColor('');
$t->SetFontColor('black');
$t->SetColor('');
$t->SetShadow('');
$t->SetFont(FF_ARIAL, FS_BOLD, 18);
$t->Set('Normal', 1, 1, 8);
$t->Stroke($g->img, $scale);
$t->Set('Italic style', 9, 1, 8);
$t->Stroke($g->img, $scale);
$t->Set('Bold style', 17.5, 1, 8);
$t->Stroke($g->img, $scale);
$t->SetFillColor('yellow');
$t->SetFontColor('black');
$t->SetColor('black');
$t->SetShadow('gray');
$r = 6;
$c = 1;
$w = 7.5;
$h = 3.5;
$fonts = array(array("Font 0", FF_FONT0, FS_NORMAL), array("", FF_FONT0, FS_ITALIC), array("", FF_FONT0, FS_BOLD), array("Font 1", FF_FONT1, FS_NORMAL), array("", FF_FONT1, FS_ITALIC), array("Font 1 bold", FF_FONT1, FS_BOLD), array("Font 2", FF_FONT2, FS_NORMAL), array("", FF_FONT2, FS_ITALIC), array("Font 2 bold", FF_FONT2, FS_BOLD), array("Arial", FF_ARIAL, FS_NORMAL), array("Arial italic", FF_ARIAL, FS_ITALIC), array("Arial bold", FF_ARIAL, FS_BOLD), array("Verdana", FF_VERDANA, FS_NORMAL), array("Verdana italic", FF_VERDANA, FS_ITALIC), array("Verdana bold", FF_VERDANA, FS_BOLD), array("Trebuche", FF_TREBUCHE, FS_NORMAL), array("Trebuche italic", FF_TREBUCHE, FS_ITALIC), array("Trebuche bold", FF_TREBUCHE, FS_BOLD), array("Georgia", FF_GEORGIA, FS_NORMAL), array("Georgia italic", FF_GEORGIA, FS_ITALIC), array("Georgia bold", FF_GEORGIA, FS_BOLD), array("Comic", FF_COMIC, FS_NORMAL), array("", FF_COMIC, FS_ITALIC), array("Comic bold", FF_COMIC, FS_BOLD), array("Courier", FF_COURIER, FS_NORMAL), array("Courier italic", FF_COURIER, FS_ITALIC), array("Courier bold", FF_COURIER, FS_BOLD), array("Times normal", FF_TIMES, FS_NORMAL), array("Times italic", FF_TIMES, FS_ITALIC), array("Times bold", FF_TIMES, FS_BOLD), array("Vera normal", FF_VERA, FS_NORMAL), array("Vera italic", FF_VERA, FS_ITALIC), array("Vera bold", FF_VERA, FS_BOLD), array("Vera mono normal", FF_VERAMONO, FS_NORMAL), array("Vera mono italic", FF_VERAMONO, FS_ITALIC), array("Vera mono bold", FF_VERAMONO, FS_BOLD), array("Vera serif normal", FF_VERASERIF, FS_NORMAL), array("", FF_VERASERIF, FS_ITALIC), array("Vera serif bold", FF_VERASERIF, FS_BOLD), array("DejaVu sans serif", FF_DV_SANSSERIF, FS_NORMAL), array("DejaVu sans serif", FF_DV_SANSSERIF, FS_ITALIC), array("DejaVu sans serif", FF_DV_SANSSERIF, FS_BOLD), array("DejaVu serif", FF_DV_SERIF, FS_NORMAL), array("DejaVu serif", FF_DV_SERIF, FS_ITALIC), array("DejaVu serif", FF_DV_SERIF, FS_BOLD), array("DejaVuMono sans serif", FF_DV_SANSSERIFMONO, FS_NORMAL), array("DejaVuMono sans serif", FF_DV_SANSSERIFMONO, FS_ITALIC), array("DejaVuMono sans serif", FF_DV_SANSSERIFMONO, FS_BOLD), array("DejaVuCond serif", FF_DV_SERIFCOND, FS_NORMAL), array("DejaVuCond serif", FF_DV_SERIFCOND, FS_ITALIC), array("DejaVuCond serif", FF_DV_SERIFCOND, FS_BOLD), array("DejaVuCond sans serif", FF_DV_SANSSERIFCOND, FS_NORMAL), array("DejaVuCond sans serif", FF_DV_SANSSERIFCOND, FS_ITALIC), array("DejaVuCond sans serif", FF_DV_SANSSERIFCOND, FS_BOLD));
$n = count($fonts);