You are here

protected function TextOverlayImageEffect::strokeMode in Image Effects 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageEffect/TextOverlayImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\TextOverlayImageEffect::strokeMode()
  2. 8.2 src/Plugin/ImageEffect/TextOverlayImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\TextOverlayImageEffect::strokeMode()

Get the stroke mode for the font.

Return value

string|null The stroke mode.

1 call to TextOverlayImageEffect::strokeMode()
TextOverlayImageEffect::getSummary in src/Plugin/ImageEffect/TextOverlayImageEffect.php
Returns a render array summarizing the configuration of the image effect.

File

src/Plugin/ImageEffect/TextOverlayImageEffect.php, line 1066

Class

TextOverlayImageEffect
Overlays text on the image, defining text font, size and positioning.

Namespace

Drupal\image_effects\Plugin\ImageEffect

Code

protected function strokeMode() {
  if ($this->configuration['font']['stroke_mode'] == 'outline' && ($this->configuration['font']['outline_top'] || $this->configuration['font']['outline_right'] || $this->configuration['font']['outline_bottom'] || $this->configuration['font']['outline_left'])) {
    return $this
      ->t('Outline');
  }
  elseif ($this->configuration['font']['stroke_mode'] == 'shadow') {
    return $this
      ->t('Shadow');
  }
  else {
    return NULL;
  }
}