本文整理匯總了PHP中securimage::getFontFromDirectory方法的典型用法代碼示例。如果您正苦於以下問題:PHP securimage::getFontFromDirectory方法的具體用法?PHP securimage::getFontFromDirectory怎麽用?PHP securimage::getFontFromDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類securimage
的用法示例。
在下文中一共展示了securimage::getFontFromDirectory方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: securimage
* @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
* @copyright 2009 Drew Phillips
* @author drew010 <drew@drew-phillips.com>
* @version 2.0 BETA (November 15, 2009)
* @package Securimage
*
*/
include 'securimage.php';
$img = new securimage();
//Change some settings
$img->code_length = 4;
$img->image_width = 175;
$img->image_height = 60;
$img->perturbation = 0.7;
// 1.0 = high distortion, higher numbers = more distortion
$img->charset = 'ABCDEFHKLMNPRSTUVWYZabcdefhkmnpstuvwyz234578';
//$img->ttf_file = './ttffonts/AHGBold.ttf'; // single font
$img->ttf_font_directory = getcwd() . '/ttffonts';
// random fonts
$img->ttf_file = $img->getFontFromDirectory();
// random fonts
$img->multi_text_color = array('#6666FF', '#660000', '#3333CC', '#993300', '#0060CC', '#339900', '#6633CC', '#330000', '#006666', '#CC3366');
$img->use_multi_text = true;
$img->use_transparent_text = true;
$img->text_transparency_percentage = 20;
$img->num_lines = 6;
$img->line_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = 'png';
$img->background_directory = getcwd() . '/backgrounds';
$img->show('');
// alternate use: $img->show('./backgrounds/1.gif');