HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/martyknows.com/wp-content/plugins/enlighter/modules/core/FontManager.php
<?php

namespace Enlighter;

class FontManager{

    private $_cachedData = null;

    // monospace font classes used by EnlighterJS v3 + additional
    const FONTS = array(
        'sourcecodepro'     => '"Source Code Pro", "Liberation Mono", "Courier New", Courier, monospace',
        'consolas'          => '"Consolas", "Liberation Mono", "Courier New", Courier, monospace',
        'inconsolata'       => '"Inconsolata", "Liberation Mono", "Courier New", Courier, monospace',
        'courier'           => '"Courier New", Courier, monospace',
        'lucida'            => '"Lucida Console", Monaco, monospace'
    );

    // fetch font list
    public function getFonts(){
        // cached ?
        if ($this->_cachedData === null){
            $this->_cachedData = apply_filters('enlighter_fonts', self::FONTS);
        }

        return $this->_cachedData;
    }

    // get font class by name
    public function getFontByName($name){
        $fontlist = $this->getFonts();

        // font found
        if (isset($fontlist[$name])){
            return $fontlist[$name];
        
        // get first font
        }else{
            return array_values($fontlist)[0];
        }
    }
}