Hi,
Is there a trick to be able to load a custom font and use compositeImage?
Here is my code :
app.yaml
application: the_name
version: 1
runtime: php55
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /009\.jpg
static_files: 009.jpg
upload: 009\.jpg
application_readable: true
- url: /RosewoodStdRegular\.otf
static_files: RosewoodStdRegular.otf
upload: RosewoodStdRegular\.otf
mime_type: application/x-font-otf
- url: /arial\.ttf
static_files: arial.ttf
upload: arial\.ttf
mime_type: application/x-font-ttf
- url: .*
script: main.php
main.php
<?php
try {
$img = new Imagick("009.jpg");
$img->setImageCompressionQuality(100);
//ADD TEXT
$text = array(
'width' => 300,
'height'=> 80,
'x' => 420,
'y' => 160,
'font' => 'arial.ttf',
'color' => 'black',
'value' => "Coucou"
);
$addText = new Imagick();
$addText->setBackgroundColor("transparent");
$addText->setFont($text['font']);
$addText->newPseudoImage($text['width'],$text['height'], "Caption:".$text[
'value'] );
$addText->colorizeImage($text['color'],1);
$img->compositeImage($addText, Imagick::COMPOSITE_OVER, $text['x'], $text[
'y']);
$img->setImageFormat('jpg');
//header('Content-Type: image/jpg');
//echo $img;
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
But I get
Caught exception: The given font is not found in the ImageMagick
configuration and the file (app_path/1.388444744529109221/arial.ttf) is not
accessible
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/5f475242-cbbf-4fb0-a108-7f0b16a24d44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.