Example #1
0
 public function __construct()
 {
     // get locale
     $this->locale = Config::get('letterpress.locale');
     // defaults
     if (Config::get('letterpress.microtypography.useDefaults')) {
         $this->fixers = Config::get('jolitypo.defaults');
         // locale additions
         $localeKey = sprintf('jolitypo.%s', $this->locale);
         if (Config::has($localeKey)) {
             $this->fixers = array_merge($this->fixers, Config::get($localeKey));
         }
     }
     // hyphenation
     if (Config::get('letterpress.microtypography.enableHyphenation')) {
         $this->fixers[] = 'Hyphen';
     }
     // user additions
     $this->fixers = array_merge($this->fixers, Config::get('letterpress.microtypography.additionalFixers'));
     if (count($this->fixers) === 0) {
         throw new LetterpressException('Typography fixing requires setting up fixers.');
     }
     $this->fixer = new Fixer($this->fixers);
     $this->fixer->setLocale($this->locale);
 }