How can I increase the font size of codeigniter captcha helper

I am using the codeigniter * capctha * helper. The fact is, I can’t increase the font size of the letters. I tried to do this with

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 I change the font size, please help. Thanks in advance.

+5
source share
2 answers

You change the correct parameter, whether in the main file or in the application / helpers file.

Double check the font you are using. Some fonts have one size, that's all. The default font file (texb.ttf) has only one size (? I think ...).

I am using the following configuration:

//----- 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);

Select the font file and put it in the font folder and try.

+5

" " captha font_path, . path/to/your/ttfont.ttf font_path, font_size. !

0

All Articles