NexusLeads Webshell
NexusLeads


Server : LiteSpeed
System : Linux server 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : alsaif ( 1057)
PHP Version : 7.4.33
Disable Function : show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/alsaif/domains/alsaif.group/public_html/plugins/system/nrframework/NRFramework/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/alsaif/domains/alsaif.group/public_html/plugins/system/nrframework/NRFramework/Fonts.php
<?php

/**
 * @author          Tassos Marinos <info@tassos.gr>
 * @link            https://www.tassos.gr
 * @copyright       Copyright © 2024 Tassos All Rights Reserved
 * @license         GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/

namespace NRFramework;

defined( '_JEXEC' ) or die( 'Restricted access' );

use Joomla\CMS\Factory;

/**
 *  Fonts Class
 */
class Fonts
{
	/**
	 *  Classic Fonts
	 *
	 *  @var  array
	 */
	private static $classic = array(
		'Arial',
		'Arial Black',
		'Georgia',
		'Tahoma',
		'Franklin Gothic Medium',
		'Calibri',
		'Cambria',
		'Century Gothic',
		'Consolas',
		'Corbel',
		'Courier New',
		'Times New Roman',
		'Impact',
		'Lucida Console',
		'Palatino Linotype',
		'Trebuchet MS',
		'Verdana'
	);

	/**
	 *  Google Fonts List
	 *
	 *  @var  array
	 */
	private static $google = array(
		'Roboto',
		'Staatliches',
		'Thasadith',
		'Open Sans',
		'Sarabun',
		'Slabo 27px',
		'Lato',
		'Oswald',
		'Charm',
		'Roboto Condensed',
		'Source Sans Pro',
		'Montserrat',
		'Raleway',
		'PT Sans',
		'Poppins',
		'Roboto Slab',
		'Lora',
		'Droid Sans',
		'Merriweather',
		'Ubuntu',
		'Droid Serif',
		'Arimo',
		'Noto Sans',
		'PT Sans Narro'
	);

	/**
	 *  Returns all font groups alphabetically sorted
	 *
	 *  @return  array
	 */
	public static function getFontGroups()
	{
		return array(
			'Google Fonts' => self::getFontGroup('google'),
			'Classic' 	   => self::getFontGroup('classic')
		);
	}

	/**
	 *  Returns a font group alphabetically sorted
	 *
	 *  @param   string  $name  The Font Group
	 *
	 *  @return  array         
	 */
	public static function getFontGroup($name)
	{
		$fonts = self::$$name;
		sort($fonts);
		return $fonts;
	}

	/**
	 *  Loads Google font to the document
	 *
	 *  @param   mixed  $name  The Google font name
	 *
	 *  @return  void
	 */
	public static function loadFont($names)
	{
		if (!$names)
		{
			return;
		}

		if (!is_array($names))
		{
			$names = array($names);
		}

		foreach ($names as $key => $value)
		{
			// If font is a Google Font then load it into the document
	        if (in_array($value, self::$google))
	        {
	            Factory::getDocument()->addStylesheet('//fonts.googleapis.com/css?family=' . urlencode($value));
	        }
		}
	}
}

NexusLeads