我如何增加codeignager captcha助手的字体大小 [英] How can i increase the font size of codeigniter captcha helper
问题描述
我使用的是 codeigniter * capctha *助手。事情是我不能增加字母的字体大小。我试图这样做
I am using the codeigniter *capctha* helper. The thing is I can not increase the font size of letters. I tried to do it by
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;
}
但没有任何反应,如何更改字体大小,请帮助。
提前感谢。
but nothing happens, how can change the font size, please help. Thanks in advance.
推荐答案
您正在更改正确的参数,无论是核心文件还是应用程序/ helpers文件。
You are changing the correct parameter, whether in the core file or the application/helpers file.
仔细检查您使用的字体。一些字体有一个大小,就是它。默认字体文件(texb.ttf)只有一个大小(?我认为...)。
Double check the font that you are using. Some fonts have one size and that is it. The default font file (texb.ttf) has only one size (? I think...).
我使用以下配置:
//----- 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);
选择一个字体文件并将其放入fonts文件夹并尝试。
Pick a font file and place it in the fonts folder and try it out.
这篇关于我如何增加codeignager captcha助手的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!