You are here

function _image_captcha_get_enabled_fonts in CAPTCHA 7

Same name and namespace in other branches
  1. 8 image_captcha/image_captcha.module \_image_captcha_get_enabled_fonts()
  2. 6.2 image_captcha/image_captcha.module \_image_captcha_get_enabled_fonts()

Helper function for getting the fonts to use in the image CAPTCHA.

Return value

array a list of font paths.

3 calls to _image_captcha_get_enabled_fonts()
_image_captcha_check_setup in image_captcha/image_captcha.module
Helper function for checking the setup of the Image CAPTCHA.
_image_captcha_generate_image in image_captcha/image_captcha.user.inc
Base function for generating a image CAPTCHA.
_image_captcha_settings_form_font_section in image_captcha/image_captcha.admin.inc
Form elements for the font specific setting.

File

image_captcha/image_captcha.module, line 68
Implements image CAPTCHA for use with the CAPTCHA module

Code

function _image_captcha_get_enabled_fonts() {
  if (IMAGE_CAPTCHA_ERROR_NO_TTF_SUPPORT & _image_captcha_check_setup(FALSE)) {
    return array(
      'BUILTIN',
    );
  }
  else {
    $default = array(
      drupal_get_path('module', 'image_captcha') . '/fonts/Tesox/tesox.ttf',
      drupal_get_path('module', 'image_captcha') . '/fonts/Tuffy/Tuffy.ttf',
    );
    return variable_get('image_captcha_fonts', $default);
  }
}