ݛ`UP?ݛ`U`?Oݛ`U@p@Oݛ`U0@`UP ݛ`U+`ݛ`U`|ޛ`U>@ܛ`U`*`UPݛ`U`+`b`U`>@ܛ`U*`UP0ݛ`U`+`b`U`>@ܛ`U`*`UPݛ`U+ܛ`Uݛ`Up`5|ޛ`U>@ܛ`U*`UP ݛ`U`+`ݛ`U` |ޛ`U >Д`UP0ݛ`U0+ ߛ`U@cW`U`@Pݛ`UP`+`U``@ܛ`U@* ߛ`U0pc`U`pݛ`U`+`U`@ܛ`U* ߛ`Uc`U`ݛ`U@+`U``b`U`>@`U؛pR)`Uk`U+p`U 0RSޛ`UP)`UP`U` {ݛ`U `+`U`@ܛ`U*`U`@{ݛ`U@@+`U` p`U`HR`UP`pSޛ`Up`)`Uk`Up+p`U`R`UpSޛ`U)`U`b`U>ܛ`U> i' XAUA(3A`j' ؿA' j' xbA@- - 0 ' - - 00 pA@- - `0 0' ' p' p'  q' ݛ`UP_?ݛ`U`_?0!ݛ`U`9`$ݛ`U `E`U`0`p9ݛ`U`<ߛ`UP`29ݛ`U`<yޛ`U`:+`Up``Ua`$ݛ`UcE`C`UpPcB9ݛ`Uc<@ݛ`Ucݛ`U@c+ܛ`Ud>`Up hݛ`Uh.`$ݛ`U8hE(`Uhd`Up Ah^ߛ`U Phkݛ`U`ht9ݛ`U0h<0ݛ`U0h4ݛ`Uh+p`Up @XiR)`U@i@ܛ`Uh*`$ݛ`UpjE`C`UpPjBnts ) ); } if ( is_array( $variants ) ) { $key = array_search( 'inherit', $variants ); if ( false !== $key ) { unset( $variants[ $key ] ); if ( ! in_array( 400, $variants ) ) { $variants[] = 400; } } } elseif ( 'inherit' == $variants ) { $variants = 400; } if ( isset( self::$fonts[ $name ] ) ) { foreach ( (array) $variants as $variant ) { if ( ! in_array( $variant, self::$fonts[ $name ]['variants'] ) ) { self::$fonts[ $name ]['variants'][] = $variant; } } } else { self::$fonts[ $name ] = array( 'variants' => (array) $variants, ); } } /** * Get fonts * * @return array */ public static function get_fonts() { do_action( 'inspiro/get_fonts' ); return apply_filters( 'inspiro/add_fonts', self::$fonts ); } /** * Get google font url * * @return string */ public static function get_google_font_url() { return self::$google_font_url; } /** * Renders the tag for all fonts in the $fonts array. * * @since 1.3.0 * @return void */ public static function render_fonts() { $font_list = apply_filters( 'inspiro/render_fonts', self::get_fonts() ); $google_fonts = array(); $font_subset = array(); $system_fonts = Inspiro_Font_Family_Manager::get_system_fonts(); foreach ( $font_list as $name => $font ) { if ( ! empty( $name ) && ! isset( $system_fonts[ $name ] ) ) { // Add font variants. $google_fonts[ $name ] = $font['variants']; // Add Subset. $subset = apply_filters( 'inspiro/font_subset', '', $name ); if ( ! empty( $subset ) ) { $font_subset[] = $subset; } } } self::$google_font_url = self::google_fonts_url( $google_fonts, $font_subset ); wp_enqueue_style( 'inspiro-google-fonts', self::$google_font_url, array(), INSPIRO_THEME_VERSION, 'all' ); } /** * Google Font URL * Combine multiple google font in one URL * * @link https://shellcreeper.com/?p=1476 * @param array $fonts Google Fonts array. * @param array $subsets Font's Subsets array. * * @return string */ public static function google_fonts_url( $fonts, $subsets = array() ) { /* URL */ $base_url = '//fonts.googleapis.com/css'; $font_args = array(); $family = array(); $fonts = apply_filters( 'inspiro/google_fonts_selected', $fonts ); /* Format Each Font Family in Array */ foreach ( $fonts as $font_name => $font_weight ) { $font_name = str_replace( ' ', '+', $font_name ); if ( ! empty( $font_weight ) ) { if ( is_array( $font_weight ) ) { $font_weight = implode( ',', $font_weight ); } $font_family = explode( ',', $font_name ); $font_family = str_replace( "'", '', inspiro_get_prop( $font_family, 0 ) ); $family[] = trim( $font_family . ':' . rawurlencode( trim( $font_weight ) ) ); } else { $family[] = trim( $font_name ); } } /* Only return URL if font family defined. */ if ( ! empty( $family ) ) { /* Make Font Family a String */ $family = implode( '|', $family ); /* Add font family in args */ $font_args['family'] = $family; /* Add font subsets in args */ if ( ! empty( $subsets ) ) { /* format subsets to string */ if ( is_array( $subsets ) ) { $subsets = implode( ',', $subsets ); } $font_args['subset'] = rawurlencode( trim( $subsets ) ); } $font_args['display'] = 'swap'; return add_query_arg( $font_args, $base_url ); } return ''; } } } /** * Kicking this off by calling 'get_instance()' method */ Inspiro_Fonts_Manager::get_instance();