CodeIgniter Forums
Issue with "font size" - Captcha helper - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Issue with "font size" - Captcha helper (/thread-54739.html)



Issue with "font size" - Captcha helper - El Forum - 09-23-2012

[eluser]ojcarga[/eluser]
Hey guys,

I just found this little problem with setting the font size for the captcha helper, this is the current code and as it is right now, the font size that user set will never work

Code:
if ($use_font == FALSE)
{
        $font_size = 5;
        $x = rand(0, $img_width/($length/3));
        $y = 0;
}
else
{
        $font_size = 16;
        $x = rand(0, $img_width/($length/1.5));
        $y = $font_size+2;
}

I just added that piece of code to my project and it works very well, maybe that should be updated for next version of CI.


Code:
if(isset($data["font_size"]))
    $font_size = $data["font_size"]; //The font size value the user set
else
    $font_size = 16; //Default


if ($use_font == FALSE)
{
        ////$font_size = 5;
        $x = rand(0, $img_width/($length/3));
        $y = 0;
}
else
{
        ////$font_size = 16;
        $x = rand(0, $img_width/($length/1.5));
        $y = $font_size+2;
}

Hope I explained well... let me know what you think Smile

Cheers!