Arkanjel
New Member
Plankeye, I can send you a zipped file with all those images if you would like it as well. Just PM me with an email address you want them sent to.
				
			Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Plankeye said:Thanks for sending the images Arkanjel. I also had some success getting true type fonts to include in the image verses the GD fonts. Here is Sirius's background with a more gaming feel of font:
http://www.shooksweb.com/development/cga/signature/image.php?m=Tek7&s=00
The backgrounds range from 00-07 right now incase anyone is interested in playing around with it.
Here is my todo list to get this in place:
- Assign font, font color and position for every type of background
 - hook into the CGA main site's member DB
 - create either a phpNuke module or custom page to allow a member to select their preferred sig
 - See what kind of additional font formatting I can accomplish
 - Get a vBulletin custom code setup for the CGA sigs
 
What I would like is some suggestions for fonts for the various images. The crackman (pacman) plays very well with the theme of CGA. If you have any other suggestions, please post them along with a link to the True Type Font.
you can d/l some gd fonts from here http://www.widgnet.com/gdf_fonts/fonts.html$font = imageloadfont("./fonts/crackman.gdf");
to the new font file that should do it("./fonts/crackman.gdf")
astrod00d said:I like Sirius's background but I don't really like the font. Is there a way to select different fonts like the different backgrounds? I'd like to see it with a black font that stays within the lines. Cool idea.![]()
Sirius said:yea i dont favor the font either :-/
<?php
    // CGA Signature Image Creation Script 
     
    header("Content-type: image/png"); 
    if (!$_GET["m"]) { 
        $string = "Plankeye"; 
    } else { 
        $string = $_GET["m"]; 
    } 
    $im = imagecreatefrompng("sigs.png"); 
    $colorWhite = imagecolorallocate($im, 255, 255, 255); 
    $px = (imagesx($im) - 8 * strlen($string)) / 2; 
	imagettftext($im,30,0,$px,65,$colorWhite,"/fonts/lud.ttf",$string);
    imagepng($im); 
    imagedestroy($im); 
?>
	<?php
    // CGA Signature Image Creation Script 
     
    header("Content-type: image/png"); 
    if (!$_GET["m"]) { 
        $string = "Plankeye"; 
    } else { 
        $string = $_GET["m"]; 
    } 
    $im = imagecreatefrompng("sigs.png"); 
    $colorWhite = imagecolorallocate($im, 255, 255, 255); 
    // SirThom's edit on next line
    $px = (imagesx($im) - (8 * strlen($string))) / 2; 
	imagettftext($im,30,0,$px,65,$colorWhite,"/fonts/lud.ttf",$string);
    imagepng($im); 
    imagedestroy($im); 
?>
	<?
	// CGA Signature Image Creation Script
	
	// set the header type
	header("Content-type: image/png");
	
	// imagettftextalign (php.net comments from imagettftext)
	function imagettftextalign($image, $size, $angle, $x, $y, $color, $font, $text, $alignment='L') {
		// check width of the text
		$bbox = imagettfbbox ($size, $angle, $font, $text);
		$textWidth = $bbox[2] - $bbox[0];
		switch ($alignment) {
			case "R":
			$x -= $textWidth;
			break;
		case "C":
			$x -= $textWidth / 2;
			break;
		}
		
		//write text
		imagettftext ($image, $size, $angle, $x, $y, $color, $font, $text);
	}
	
	// configuration settings for backgrounds
	$signatureConfig = array(
		// Background => True Type Font Name, Font Size, Font Angle, Font Red, Font Green, Font Blue, Alignment, X Position, Vertical Alignment, Y Position
		"00" => array("font" => "crackman", "size" => 24, "angle" => 0, "r" => 255, "g" => 255, "b" => 255, "align" => "C", "x" => 0, "valign" => "", "y" => 60),
		"01" => array("font" => "crackman", "size" => 24, "angle" => 0, "r" => 255, "g" => 255, "b" => 255, "align" => "C", "x" => 0, "valign" => "", "y" => 60),
		"02" => array("font" => "crackman", "size" => 24, "angle" => 0, "r" => 255, "g" => 255, "b" => 255, "align" => "C", "x" => 0, "valign" => "", "y" => 60),
		"03" => array("font" => "crackman", "size" => 24, "angle" => 0, "r" => 255, "g" => 255, "b" => 255, "align" => "C", "x" => 0, "valign" => "", "y" => 60),
		"04" => array("font" => "crackman", "size" => 24, "angle" => 0, "r" => 255, "g" => 255, "b" => 255, "align" => "C", "x" => 0, "valign" => "", "y" => 60),
		"05" => array("font" => "crackman", "size" => 24, "angle" => 0, "r" => 255, "g" => 255, "b" => 255, "align" => "C", "x" => 0, "valign" => "", "y" => 60),
		"06" => array("font" => "crackman", "size" => 24, "angle" => 0, "r" => 255, "g" => 255, "b" => 255, "align" => "C", "x" => 0, "valign" => "", "y" => 60),
		"07" => array("font" => "crackman", "size" => 24, "angle" => 0, "r" => 255, "g" => 255, "b" => 255, "align" => "C", "x" => 0, "valign" => "", "y" => 60)
	);
	
	// pull in the member information
	if (!$_GET["m"]) {
		$string = "Unkown Player";
	} else {
		$string = $_GET["m"];
	}
	
	// pull in the preferred signature background
	if (!$_GET["s"]) {
		$background = "00";
	} else {
		$background = $_GET["s"];
		// check real quick to make sure the selected background exists
		if(!$signatureConfig[$background])
			$background = "00";
	}
	
	$im = imagecreatefrompng("./backgrounds/signature$background.png");
	$color = imagecolorallocate($im, $signatureConfig[$background]["r"], $signatureConfig[$background]["g"], $signatureConfig[$background]["b"]);
	$px = (imagesx($im) - 24 * strlen($string)) / 2;
	//$font = imageloadfont("./fonts/crackman.ttf");
	//imagestring($im, 5, $px, 43, $string, $colorWhite);
	imagettftext($im, 24, 0, $px, 60, $color, "./fonts/crackman.ttf", $string);
	imagepng($im);
	imagedestroy($im);
?>
	
	import java.awt.*;
import javax.swing.JApplet;
public class BarChart extends JApplet
{
	int total;
	int airPlane = 280;
	int hotel = 420;
	double airPlanePercent;
	double hotelPercent;
	
	public void init()
	{
		//calculate the total BarChart
		total = airPlane + hotel;
		//calculate the percentages for each item
		airPlanePercent = 100.0 * airPlane / total;
		hotelPercent = 100.0 * hotel / total;
	}
	public void paint (Graphics g)
	{
		//print the title
		g.setColor(Color.red);
		g.drawString("Vacation Expenses", 30, 50);
		
		//draw the bar chart
		g.setColor(Color.black);
		g.drawString("Airplane " + airPlanePercent + "%", 25, 85);
		g.setColor(Color.blue);
		g.fillRect(145, 70, (int)(4 * airPlanePercent), 20);
		g.setColor(Color.black);
		g.drawString("HOtel " + hotelPercent + "%", 25, 115);
		g.setColor(Color.blue);
		g.fillRect(145, 100, (int)(4 * hotelPercent), 20);
	}
}
	<applet code="http://www.compmil.com/cga/BarChart.class" height="300" width="300"></applet>