Skip to content

Commit

Permalink
Add facebook source file
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Gertz committed Nov 22, 2024
1 parent 5c417dd commit 0ae04c5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions public/facebook/source.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php declare(strict_types=1);

/*
* This file is part of the Rapsys PackBundle package.
*
* (c) Raphaël Gertz <symfony@rapsys.eu>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

//Create image object
$image = new Imagick();

//Create draw object
$draw = new ImagickDraw();

//Create pixel object
$pixel = new ImagickPixel('white');

//Create new image
$image->newImage(1200, 630, $pixel);

//Set fill color
$draw->setFillColor('black');

//Set font properties
$draw->setFont('../woff2/droidsans.regular.woff2');
$draw->setFontSize(30);

//Add texts
$image->annotateImage($draw, 10, 35, 0, 'RP');
$image->annotateImage($draw, 10, 615, 0, 'RP');
$image->annotateImage($draw, 1155, 35, 0, 'RP');
$image->annotateImage($draw, 1155, 615, 0, 'RP');

//Set image format
$image->setImageFormat('png');

//Output image header
header('Content-type: image/png');

//Output image
echo $image;
Binary file added public/facebook/source.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0ae04c5

Please sign in to comment.