You are here

function _image_captcha_get_font_uri in CAPTCHA 8

Helper function to get font(s).

Return value

string|array URI of file hash or List of font paths.

2 calls to _image_captcha_get_font_uri()
CaptchaImageResponse::printString in image_captcha/src/Response/CaptchaImageResponse.php
Helper function for drawing text on the image.
ImageCaptchaSettingsForm::validateForm in image_captcha/src/Form/ImageCaptchaSettingsForm.php
Form validation handler.

File

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

Code

function _image_captcha_get_font_uri($token = NULL) {
  $fonts = [
    'BUILTIN' => 'BUILTIN',
  ];
  $available_fonts = _image_captcha_get_available_fonts_from_directories();
  foreach ($available_fonts as $file_token => $font_info) {
    $fonts[$file_token] = $font_info['uri'];
  }
  return !empty($token) && !empty($fonts[$token]) ? $fonts[$token] : $fonts;
}