Php 如何增加codeigniter验证码助手的字体大小

Php 如何增加codeigniter验证码助手的字体大小,php,codeigniter,captcha,helper,Php,Codeigniter,Captcha,Helper,我正在使用codeigniter*capctha*辅助程序。问题是我不能增加字母的字体大小。我试着用手做这件事 if ($use_font == FALSE) { $font_size = 6; $x = rand(0, $img_width/($length/2)); $y = 0; } else { $font_size = 20; $x = rand(0, $img_width/($length/1.5)); $y = $font_size+

我正在使用codeigniter*capctha*辅助程序。问题是我不能增加字母的字体大小。我试着用手做这件事

if ($use_font == FALSE)
{
    $font_size = 6;
    $x = rand(0, $img_width/($length/2));
    $y = 0;
}
else
{
    $font_size = 20;
    $x = rand(0, $img_width/($length/1.5));
    $y = $font_size+2;
}
但是什么也没发生,怎么能改变字体大小,请帮忙。
提前感谢。

您正在更改正确的参数,无论是在核心文件还是应用程序/助手文件中

仔细检查您正在使用的字体。有些字体只有一种大小,就是这样。默认字体文件(texb.ttf)只有一个大小(?我想…)

我正在使用以下配置:

//----- Captcha Implementation -----
$this->load->helper('captcha');

$captchaSetup = array(
    'img_path'   => './captcha/',
    'img_url'    => base_url()."captcha/",
    'font_path'  => './assets/fonts/E004007T.TTF',
    'img_width'  => 250,
    'img_height' => 50,
    'expiration' => 7200
);

$capData['cap'] = create_captcha($captchaSetup);

选择一个字体文件并将其放入字体文件夹中,然后试用。

您可以在captha的
font\u路径中使用“true type”字体来获得更大的大小。尝试在
font\u path
中设置
path/to/your/ttfont.ttf
,然后将较大的值传递给
font\u size
。它应该有用

是的,默认字体(texb.ttf)似乎只有一个大小。我试着换成另一种字体,一切都很好。