Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Load our signature base or background image.
- $sig = new Imagick('images/sig/sigbackground.png');
- // Load a class icon
- $class_icon = new Imagick(strtolower($soe_character_data->class).'.png');
- // Composite the class icon onto the background image.
- $sig->compositeImage($class_icon, $class_icon->getImageCompose(), 19, 49);
- // Create our temp drawing object.
- $draw = new ImagickDraw();
- // Pick a different font based on the character's server, in this case we load an OpenType font stored in my directory.
- if ($soe_character_data->server == 'Barren Sky') {
- $draw->setFont('Century-Schoolbook-Bold');
- } else {
- $draw->setFont('/home/********/public_html/images/sig/fedrascbold.otf');
- }
- // Set font size
- $draw->setFontSize(20);
- // Set draw color
- $draw->setFillColor('#fefcdc');
- // Add character name
- $sig->annotateImage ($draw, 19, 34, 0, $soe_character_data->name_first );
- // Text alignment
- $draw->setTextAlignment(Imagick::ALIGN_CENTER);
- $draw->setTextAlignment(Imagick::ALIGN_LEFT);
- // Delete old file if it exists
- unlink($filename);
- // Write out the new file
- $sig->setImageCompression(Imagick::COMPRESSION_JPEG);
- $sig->setImageCompressionQuality(92);
- $sig->setImageFormat( "jpeg" );
- $sig->writeImage($filename);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement