Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Last active Aug 29, 2015
Embed
What would you like to do?
<?php
// autofit_text_to_image() example
// http://cgd.io/2014/auto-fit-text-to-an-image-with-php-and-wordpress
$canvas_image_filename = 'quote_canvas.png';
$dest_filename = 'quote.jpg';
$text = 'I believe in pink. I believe that laughing is the best calorie burner. I believe in kissing, kissing a lot.';
$font_file = 'Cedarville-Cursive.ttf';
autofit_text_to_image($canvas_image_filename, $dest_filename, $text, 60, 500, 400, 40, 400, $font_file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment