'0px', 'line-height' => '0px', 'letter-spacing' => '0px', 'text-hshadow' => '0px', 'text-vshadow' => '0px', 'text-blur' => '0px', 'use' => 0, 'font-family' => '', 'font-style' => '', 'font-weight' => '', 'font-decoration' => '', 'font-transform' => '', 'font-google' => '', 'font-google-variant' => '', 'color' => '', 'text-shadowcolor' => '' ); $value = wp_parse_args( $value, $defaults ); // getting values if( $value['color'] ) $cp_style = sprintf(' style="background:%1$s;border-color:%1$s"', $value['color']); if( $value['text-shadowcolor'] ) $tsc_style = sprintf(' style="background:%1$s;border-color:%1$s"', $value['text-shadowcolor']); ?>
array ( 'range' => 'min', 'min' => 1, 'max' => 120, 'value' => (int)$fontsize_value ), "#{$id}-linehight" => array ( 'range' => 'min', 'min' => 7, 'max' => 89, 'value' => (int)$line_height_value ), "#{$id}-letterspacing" => array ( 'min' => -20, 'max' => 20, 'value' => (int)$letter_spacing_value ), "#{$id}-hshadow" => array ( 'min' => -50, 'max' => 50, 'value' => (int)$slider_hshadow_value ), "#{$id}-vshadow" => array ( 'min' => -50, 'max' => 50, 'value' => (int)$slider_vshadow_value ), "#{$id}-blur" => array ( 'range' => 'min', 'min' => 0, 'max' => 100, 'value' => (int)$slider_blur_value ) ); $js = "panelUi.bind_typography( '{$id}', ".json_encode($typo).");"; if($is_widget) { if(!$is_builder) add_jquery_ready($js); else $ui_content .= sprintf( '', $js, "\n" ); return $ui_content; } else { echo $ui_content; add_jquery_ready($js); } } function spyropress_widget_typography( $item, $id, $value, $is_builder = false ) { return spyropress_ui_typography( $item, $id, $value, true, $is_builder ); } /** * Generate style attribute for preview */ function spyropress_font_preview( $styles ) { if( $styles['color'] ) echo 'color:'.$styles['color'].';'; if( $styles['font-family'] ) echo 'font-family:'.$styles['font-family'].';'; if( $styles['font-weight'] ) echo 'font-weight:'.$styles['font-weight'].';'; if( $styles['font-transform'] ) echo 'text-transform:'.$styles['font-transform'].';'; if( $styles['font-style'] ) echo 'font-style:'.$styles['font-style'].';'; if( $styles['font-decoration'] ) echo 'text-decoration:'.$styles['font-decoration'].';'; if( $styles['font-size'] && $styles['font-size'] != '0px' ) echo 'font-size:'.$styles['font-size'].';'; if( $styles['line-height'] && $styles['line-height'] != '0px') echo 'line-height:'.$styles['line-height'].';'; if( $styles['letter-spacing'] && $styles['letter-spacing'] != '0px' ) echo 'letter-spacing:'.$styles['letter-spacing'].';'; if( $styles['text-shadowcolor'] ) echo 'text-shadow:'.$styles['text-hshadow'].' '.$styles['text-vshadow'].' '.$styles['text-blur'].' '.$styles['text-shadowcolor'].';'; } /** * Font Families * @uses apply_filters() */ function spyropress_panel_font_families() { return apply_filters( 'spyropress_font_families', array( '' => '', 'arial' => __( 'Arial', 'spyropress' ), 'georgia' => __( 'Georgia', 'spyropress' ), 'helvetica' => __( 'Helvetica', 'spyropress' ), 'palatino' => __( 'Palatino', 'spyropress' ), 'tahoma' => __( 'Tahoma', 'spyropress' ), 'times' => __( '"Times New Roman", sans-serif', 'spyropress' ), 'trebuchet' => __( 'Trebuchet', 'spyropress' ), 'verdana' => __( 'Verdana', 'spyropress' ) )); } /** * Font Weights */ function spyropress_panel_font_weights() { return array( '' => '', 'normal' => __( 'Normal', 'spyropress' ), 'bold' => __( 'Bold', 'spyropress' ), 'bolder' => __( 'Bolder', 'spyropress' ), 'lighter' => __( 'Lighter', 'spyropress' ), '100' => __( '100', 'spyropress' ), '200' => __( '200', 'spyropress' ), '300' => __( '300', 'spyropress' ), '400' => __( '400', 'spyropress' ), '500' => __( '500', 'spyropress' ), '600' => __( '600', 'spyropress' ), '700' => __( '700', 'spyropress' ), '800' => __( '800', 'spyropress' ), '900' => __( '900', 'spyropress' ), 'inherit' => __( 'Inherit', 'spyropress' ) ); } /** * Font Transform */ function spyropress_panel_font_transform() { return array( '' => '', 'none' => __( 'None', 'spyropress' ), 'uppercase' => __( 'UpperCase', 'spyropress' ), 'lowercase' => __( 'LowerCase', 'spyropress' ), 'capitalize' => __( 'Capitalize', 'spyropress' ) ); } /** * Font Styles */ function spyropress_panel_font_styles() { return array( '' => '', 'normal' => __( 'Normal', 'spyropress' ), 'italic' => __( 'Italic', 'spyropress' ), 'oblique' => __( 'Oblique', 'spyropress' ), 'inherit' => __( 'Inherit', 'spyropress' ) ); } /** * Font Decoration */ function spyropress_panel_font_decoration() { return array( '' => '', 'none' => __( 'None', 'spyropress' ), 'line-through' => __( 'Line-Through', 'spyropress' ), 'overline' => __( 'Overline', 'spyropress' ), 'underline' => __( 'Underline', 'spyropress' ), 'inherit' => __( 'Inherit', 'spyropress' ) ); } ?>