-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring letter spacing in write text methods
- Loading branch information
Franck ALARY
committed
Nov 9, 2022
1 parent
9a6f48c
commit b2bfa29
Showing
3 changed files
with
127 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
require_once '../Geometry2D.php'; | ||
require_once '../Image.php'; | ||
|
||
use \DantSu\PHPImageEditor\Image; | ||
|
||
\header('Content-type: image/png'); | ||
|
||
$image1 = Image::newCanvas(500, 500); | ||
$bbox = $image1->writeTextAndGetBoundingBox('I got the power !', __DIR__ . '/resources/font.ttf', 40, '#FFFFFF', Image::ALIGN_RIGHT, Image::ALIGN_BOTTOM, Image::ALIGN_RIGHT, Image::ALIGN_BOTTOM, 0, 1); | ||
|
||
Image::newCanvas(500, 500) | ||
->drawPolygon( | ||
[ | ||
$bbox['top-left']['x'], $bbox['top-left']['y'], | ||
$bbox['top-right']['x'], $bbox['top-right']['y'], | ||
$bbox['bottom-right']['x'], $bbox['bottom-right']['y'], | ||
$bbox['bottom-left']['x'], $bbox['bottom-left']['y'] | ||
], | ||
'00000088' | ||
) | ||
->pasteOn($image1) | ||
->displayPNG(); |