Last active
February 17, 2019 17:19
-
-
Save Gkiokan/8feeebeaaa069ae6b1a09a3af228de09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
VC Additions file for Extensions | |
*/ | |
namespace G\VC; | |
new Fonts; | |
class Fonts { | |
/* | |
Variables | |
*/ | |
public static $vc = 'GREYD'; | |
public static $font_family = [ | |
'Standard Schriftart' => 'font_default_no_selection', | |
'Clean Sans' => 'font_clean_sans', | |
'Comfortaa' => 'font_comfortaa', | |
'Quicksand' => 'font_quicksand', | |
]; | |
public static $font_list = "Clear Sans='Clear Sans';Comfortaa=Comfortaa;Quicksand=Quicksand;Kristi=Kristi;"; | |
public function __construct(){ | |
add_filter('tiny_mce_before_init', [$this, 'mod']); | |
add_filter('mce_buttons_2', [$this, 'activate_fonts']); | |
} | |
public function activate_fonts($btn){ | |
if( !isset($btn['fontselect']) ) | |
$btn[] = 'fontselect'; | |
$btn[] = 'fontsizeselect'; | |
return $btn; | |
} | |
public function mod($op){ | |
$fonts = $op['font_formats']; | |
$defaults = "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats"; | |
$op['font_formats'] = self::$font_list . '----------=Clear Sans' . $defaults; | |
$op['fontsize_formats'] = "9px 10px 12px 13px 14px 16px 18px 21px 24px 28px 32px 36px 40px 42px 46px 50px 55px 60px"; | |
return $op; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment