function iek_get_watermark_fonts in Image effect kit 8
Same name and namespace in other branches
- 7 iek.module \iek_get_watermark_fonts()
Gets a list of available watermark fonts.
Parameters
string $font_name: A font name if you just want to get a particular watermark font. Leaves empty if you want to get all available watermark fonts.
Return value
array Particular watermark font if the 'font_name' is given. All available watermark fonts otherwise.
2 calls to iek_get_watermark_fonts()
- ImageWatermark::execute in src/Plugin/ ImageToolkit/ Operation/ gd/ ImageWatermark.php 
- Performs the actual manipulation on the image.
- ImageWatermarkEffect::buildConfigurationForm in src/Plugin/ ImageEffect/ ImageWatermarkEffect.php 
- Form constructor.
File
- ./iek.module, line 219 
- Contains "iek" module.
Code
function iek_get_watermark_fonts($font_name = '') {
  $fonts = \Drupal::moduleHandler()
    ->invokeAll('iek_watermark_font');
  // Invoke hook_iek_watermark_fonts_alter().
  // To allow all modules to alter the fonts.
  \Drupal::moduleHandler()
    ->alter('iek_watermark_font', $fonts);
  if (!empty($font_name)) {
    if (isset($fonts[$font_name])) {
      return $fonts[$font_name];
    }
    else {
      return [];
    }
  }
  return $fonts;
}