Your IP : 216.73.216.240


Current Path : /home/juvelize/saulnois/tmp/install_695d2cf0b4957/src/View/Html/
Upload File :
Current File : /home/juvelize/saulnois/tmp/install_695d2cf0b4957/src/View/Html/TFont.php

<?php
/*
* @package		Tech Fry Library
* @license		https://www.gnu.org/licenses/gpl-3.0.en.html
*/

namespace TechFry\Library\View\Html;

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

class TFont
{
    public $type;
    
    public $head;
    
    public function __construct($type)
    {
        $this->type = $type;

        $this->head = new THead();
    }
    
    // https://modernfontstacks.com/
    public function get_font_stack()
    {
        switch ($this->type)
        {
            case 1 : // System UI
                return 'system-ui, sans-serif';
                break;

            case 2 : // Transitional
                return 'Charter, "Bitstream Charter", "Sitka Text", Cambria, serif';
                break;

            case 3 : // Old Style
                return '"Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif';
                break;

            case 4 : // Humanist   
                return 'Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif';
                break;

            case 5 : // Geometric Humanist  
                return 'Avenir, Montserrat, Corbel, "URW Gothic", source-sans-pro, sans-serif';
                break;

            case 6 : // Classical Humanist
                return 'Optima, Candara, "Noto Sans", source-sans-pro, sans-serif';
                break;

            case 7 : // Neo-Grotesque
                return 'Inter, Roboto, "Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif';
                break;

            case 8 : // Monospace Slab Serif
                return '"Nimbus Mono PS", "Courier New", monospace';
                break;

            case 9 : // Monospace Code
                return 'ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace';
                break;

            case 10 : // Industrial
                return 'Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Nimbus Sans Narrow", sans-serif-condensed, sans-serif';
                break;

            case 11 : // Rounded Sans
                return 'ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, Manjari, "Arial Rounded MT", "Arial Rounded MT Bold", Calibri, source-sans-pro, sans-serif';
                break;

            case 12 : // Slab Serif
                return 'Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif", "Sitka Small", serif';
                break;

            case 13 : // Antique
                return 'Superclarendon, "Bookman Old Style", "URW Bookman", "URW Bookman L", "Georgia Pro", Georgia, serif';
                break;

            case 14 : // Didone
                return 'Didot, "Bodoni MT", "Noto Serif Display", "URW Palladio L", P052, Sylfaen, serif';
                break;

            case 15 : // Handwritten
                return '"Segoe Print", "Bradley Hand", Chilanka, TSCu_Comic, casual, cursive';
                break;
        }
    }

    public function get_font_css($selector)
    {
        $font_family = $this->get_font_stack();

        $css_code = $this->head->css($selector, array('font-family' => $font_family));

        return $css_code;
    }
}