From a415c29efee45520ae252d2aa28f1083a521cd7b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:56:49 +0200 Subject: Adding upstream version 6.4.3+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/fonts.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 wp-includes/fonts.php (limited to 'wp-includes/fonts.php') diff --git a/wp-includes/fonts.php b/wp-includes/fonts.php new file mode 100644 index 0000000..306364b --- /dev/null +++ b/wp-includes/fonts.php @@ -0,0 +1,53 @@ + array[] $variations { + * Optional. An associated array of font variations for this font-family. + * Each variation has the following structure. + * + * @type array $font_variation { + * @type string $font-family The font-family property. + * @type string|string[] $src The URL(s) to each resource containing the font data. + * @type string $font_style Optional. The font-style property. Default 'normal'. + * @type string $font-weight Optional. The font-weight property. Default '400'. + * @type string $font-display Optional. The font-display property. Default 'fallback'. + * @type string $ascent-override Optional. The ascent-override property. + * @type string $descent-override Optional. The descent-override property. + * @type string $font-stretch Optional. The font-stretch property. + * @type string $font-variant Optional. The font-variant property. + * @type string $font-feature-settings Optional. The font-feature-settings property. + * @type string $font-variation-settings Optional. The font-variation-settings property. + * @type string $line-gap-override Optional. The line-gap-override property. + * @type string $size-adjust Optional. The size-adjust property. + * @type string $unicode-range Optional. The unicode-range property. + * } + * } + * } + */ +function wp_print_font_faces( $fonts = array() ) { + + if ( empty( $fonts ) ) { + $fonts = WP_Font_Face_Resolver::get_fonts_from_theme_json(); + } + + if ( empty( $fonts ) ) { + return; + } + + $wp_font_face = new WP_Font_Face(); + $wp_font_face->generate_and_print( $fonts ); +} -- cgit v1.2.3