wp/wp-includes/fonts.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
    53 	$wp_font_face = new WP_Font_Face();
    53 	$wp_font_face = new WP_Font_Face();
    54 	$wp_font_face->generate_and_print( $fonts );
    54 	$wp_font_face->generate_and_print( $fonts );
    55 }
    55 }
    56 
    56 
    57 /**
    57 /**
       
    58  * Generates and prints font-face styles defined the the theme style variations.
       
    59  *
       
    60  * @since 6.7.0
       
    61  *
       
    62  */
       
    63 function wp_print_font_faces_from_style_variations() {
       
    64 	$fonts = WP_Font_Face_Resolver::get_fonts_from_style_variations();
       
    65 
       
    66 	if ( empty( $fonts ) ) {
       
    67 		return;
       
    68 	}
       
    69 
       
    70 	wp_print_font_faces( $fonts );
       
    71 }
       
    72 
       
    73 /**
    58  * Registers a new font collection in the font library.
    74  * Registers a new font collection in the font library.
    59  *
    75  *
    60  * See {@link https://schemas.wp.org/trunk/font-collection.json} for the schema
    76  * See {@link https://schemas.wp.org/trunk/font-collection.json} for the schema
    61  * the font collection data must adhere to.
    77  * the font collection data must adhere to.
    62  *
    78  *
   247 	wp_register_font_collection(
   263 	wp_register_font_collection(
   248 		'google-fonts',
   264 		'google-fonts',
   249 		array(
   265 		array(
   250 			'name'          => _x( 'Google Fonts', 'font collection name' ),
   266 			'name'          => _x( 'Google Fonts', 'font collection name' ),
   251 			'description'   => __( 'Install from Google Fonts. Fonts are copied to and served from your site.' ),
   267 			'description'   => __( 'Install from Google Fonts. Fonts are copied to and served from your site.' ),
   252 			'font_families' => 'https://s.w.org/images/fonts/wp-6.5/collections/google-fonts-with-preview.json',
   268 			'font_families' => 'https://s.w.org/images/fonts/wp-6.7/collections/google-fonts-with-preview.json',
   253 			'categories'    => array(
   269 			'categories'    => array(
   254 				array(
   270 				array(
   255 					'name' => _x( 'Sans Serif', 'font category' ),
   271 					'name' => _x( 'Sans Serif', 'font category' ),
   256 					'slug' => 'sans-serif',
   272 					'slug' => 'sans-serif',
   257 				),
   273 				),