You are here

function _image_captcha_get_enabled_fonts in CAPTCHA 8

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

Getter for fonts to use in the image CAPTCHA.

Return value

array List of font paths.

3 calls to _image_captcha_get_enabled_fonts()
CaptchaImageResponse::generateImage in image_captcha/src/Response/CaptchaImageResponse.php
Base function for generating a image CAPTCHA.
ImageCaptchaSettingsForm::settingsDotSection in image_captcha/src/Form/ImageCaptchaSettingsForm.php
Form elements for the font specific setting.
_image_captcha_check_setup in image_captcha/image_captcha.module
Helper function for checking the setup of the Image CAPTCHA.

File

image_captcha/image_captcha.module, line 41
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 [
      'BUILTIN',
    ];
  }
  else {
    return \Drupal::config('image_captcha.settings')
      ->get('image_captcha_fonts');
  }
}