You are here

public static function ViewsPdfBase::getAvailableHyphenatePatterns in Views PDF 8

This method returns a list of hyphenation patterns, that are available.

3 calls to ViewsPdfBase::getAvailableHyphenatePatterns()
Fields::options_form in src/Plugin/views/row/Fields.php
Provide a form for setting options.
Page::buildOptionsForm in src/Plugin/views/display/Page.php
Provide a form to edit options for this plugin.
ViewsPdfBase::renderRow in src/ViewsPdfBase.php

File

src/ViewsPdfBase.php, line 1171
Contains \Drupal\views_pdf\ViewsPdfTemplate.

Class

ViewsPdfBase
The main class to generate the PDF.

Namespace

Drupal\views_pdf

Code

public static function getAvailableHyphenatePatterns() {
  if (self::$hyphenatePatterns != NULL) {
    return self::$hyphenatePatterns;
  }
  self::$hyphenatePatterns = [];
  $files = file_scan_directory(libraries_get_path('tcpdf') . '/hyphenate_patterns', '/.tex$/', [
    'nomask' => '/(\\.\\.?|CVS)$/',
  ], 1);
  foreach ($files as $file) {
    self::$hyphenatePatterns[basename($file->uri)] = str_replace('hyph-', '', $file->name);
  }
  return self::$hyphenatePatterns;
}