/[health_html]/button.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /button.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by ravilov, Fri Sep 7 12:55:13 2001 UTC revision 1.3 by ravilov, Wed Sep 19 12:23:56 2001 UTC
# Line 1  Line 1 
1  <?php  <?php
2          if (!$text) exit;          if (!$text) exit;
3            $fontsize = 9;  // pixels
4          $map = array(          $map = array(
5                  "è" => 269, "è" => 269,                  "è" => 269, "è" => 269,
6                  "æ" => 263, "æ" => 263,                  "æ" => 263, "æ" => 263,
# Line 14  Line 15 
15          );          );
16          while (list($k, $v) = each($map)) $text = str_replace($k, "&#".$v.";", $text);          while (list($k, $v) = each($map)) $text = str_replace($k, "&#".$v.";", $text);
17          $text = preg_replace("/\\\(.)/", '$1', $text);          $text = preg_replace("/\\\(.)/", '$1', $text);
18          $im = ImageCreate(130, 18);          $im = ImageCreate(130, $fontsize + 10);
19          $dark = ImageColorAllocate($im, 0x66, 0x99, 0x66);          $dark = ImageColorAllocate($im, 0x66, 0x99, 0x66);
20          $mid = ImageColorAllocate($im, 0xB6, 0xE1, 0xCB);          $mid = ImageColorAllocate($im, 0xB6, 0xE1, 0xCB);
21          $light = ImageColorAllocate($im, 0xFF, 0xFF, 0xFF);          $light = ImageColorAllocate($im, 0xFF, 0xFF, 0xFF);
# Line 25  Line 26 
26          ImageLine($im, 0, ImageSY($im) - 1, ImageSX($im) - 1, ImageSY($im) - 1, $dark);          ImageLine($im, 0, ImageSY($im) - 1, ImageSX($im) - 1, ImageSY($im) - 1, $dark);
27          $txt = ImageColorAllocate($im, 0x33, 0x66, 0x33);          $txt = ImageColorAllocate($im, 0x33, 0x66, 0x33);
28          if ($type) {          if ($type) {
29                  ImageTTFText($im, 8, 0, 4, 13, $light, "verdanab.ttf", $text);                  ImageTTFText($im, $fontsize, 0, 4, $fontsize + 5, $light, "verdanab.ttf", $text);
30                  ImageTTFText($im, 8, 0, 3, 12, $dark, "verdanab.ttf", $text);                  ImageTTFText($im, $fontsize, 0, 3, $fontsize + 4, $dark, "verdanab.ttf", $text);
31          } else ImageTTFText($im, 8, 0, 3, 12, $txt, "verdanab.ttf", $text);          } else ImageTTFText($im, $fontsize, 0, 3, $fontsize + 4, $txt, "verdanab.ttf", $text);
32          $types = ImageTypes();          $types = ImageTypes();
33          if ($types & IMG_GIF) {          if ($types & IMG_GIF) {
34                  Header("Content-Type: image/gif");                  Header("Content-Type: image/gif");

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.26