<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[59260] trunk: Editor: Load all style variation fonts within the editors.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/59260">59260</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/59260","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>peterwilsoncc</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-10-20 23:23:11 +0000 (Sun, 20 Oct 2024)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Editor: Load all style variation fonts within the editors.

Loads the font family files from style variations defined within a theme for user in the site and post editors. This is to ensure the fonts are shown while editing without the need for a reload after switching styles.

Props ironprogrammer, mmaattiiaass.
Fixes <a href="https://core.trac.wordpress.org/ticket/62231">#62231</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesadminfiltersphp">trunk/src/wp-admin/includes/admin-filters.php</a></li>
<li><a href="#trunksrcwpincludesblockeditorphp">trunk/src/wp-includes/block-editor.php</a></li>
<li><a href="#trunksrcwpincludesfontsclasswpfontfaceresolverphp">trunk/src/wp-includes/fonts/class-wp-font-face-resolver.php</a></li>
<li><a href="#trunksrcwpincludesfontsphp">trunk/src/wp-includes/fonts.php</a></li>
<li><a href="#trunktestsphpunittestsfontsfontfacewpfontfacetestsdatasetphp">trunk/tests/phpunit/tests/fonts/font-face/wp-font-face-tests-dataset.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestsfontsfontfacewpFontFaceResolvergetFontsFromStyleVariationsphp">trunk/tests/phpunit/tests/fonts/font-face/wpFontFaceResolver/getFontsFromStyleVariations.php</a></li>
<li><a href="#trunktestsphpunittestsfontsfontfacewpPrintFontFacesFromStyleVariationsphp">trunk/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesadminfiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/admin-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/admin-filters.php     2024-10-20 13:11:24 UTC (rev 59259)
+++ trunk/src/wp-admin/includes/admin-filters.php       2024-10-20 23:23:11 UTC (rev 59260)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,3 +172,4 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> // Font management.
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'admin_print_styles', 'wp_print_font_faces', 50 );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_action( 'admin_print_styles', 'wp_print_font_faces_from_style_variations', 50 );
</ins></span></pre></div>
<a id="trunksrcwpincludesblockeditorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/block-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/block-editor.php    2024-10-20 13:11:24 UTC (rev 59259)
+++ trunk/src/wp-includes/block-editor.php      2024-10-20 23:23:11 UTC (rev 59260)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -366,6 +366,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        ob_start();
</span><span class="cx" style="display: block; padding: 0 10px">        wp_print_styles();
</span><span class="cx" style="display: block; padding: 0 10px">        wp_print_font_faces();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        wp_print_font_faces_from_style_variations();
</ins><span class="cx" style="display: block; padding: 0 10px">         $styles = ob_get_clean();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        if ( $has_emoji_styles ) {
</span></span></pre></div>
<a id="trunksrcwpincludesfontsclasswpfontfaceresolverphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/fonts/class-wp-font-face-resolver.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/fonts/class-wp-font-face-resolver.php       2024-10-20 13:11:24 UTC (rev 59259)
+++ trunk/src/wp-includes/fonts/class-wp-font-face-resolver.php 2024-10-20 23:23:11 UTC (rev 59260)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,6 +37,38 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Gets fonts defined in style variations.
+        *
+        * @since 6.7.0
+        *
+        * @return array Returns an array of font-families.
+        */
+       public static function get_fonts_from_style_variations() {
+               $variations = WP_Theme_JSON_Resolver::get_style_variations();
+               $fonts      = array();
+
+               if ( empty( $variations ) ) {
+                       return $fonts;
+               }
+
+               foreach ( $variations as $variation ) {
+                       if ( ! empty( $variation['settings']['typography']['fontFamilies']['theme'] ) ) {
+                               $fonts = array_merge( $fonts, $variation['settings']['typography']['fontFamilies']['theme'] );
+                       }
+               }
+
+               $settings = array(
+                       'typography' => array(
+                               'fontFamilies' => array(
+                                       'theme' => $fonts,
+                               ),
+                       ),
+               );
+
+               return static::parse_settings( $settings );
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Parse theme.json settings to extract font definitions with variations grouped by font-family.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.4.0
</span></span></pre></div>
<a id="trunksrcwpincludesfontsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/fonts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/fonts.php   2024-10-20 13:11:24 UTC (rev 59259)
+++ trunk/src/wp-includes/fonts.php     2024-10-20 23:23:11 UTC (rev 59260)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,6 +55,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Generates and prints font-face styles defined the the theme style variations.
+ *
+ * @since 6.7.0
+ *
+ */
+function wp_print_font_faces_from_style_variations() {
+       $fonts = WP_Font_Face_Resolver::get_fonts_from_style_variations();
+
+       if ( empty( $fonts ) ) {
+               return;
+       }
+
+       wp_print_font_faces( $fonts );
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * Registers a new font collection in the font library.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * See {@link https://schemas.wp.org/trunk/font-collection.json} for the schema
</span></span></pre></div>
<a id="trunktestsphpunittestsfontsfontfacewpfontfacetestsdatasetphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/fonts/font-face/wp-font-face-tests-dataset.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/fonts/font-face/wp-font-face-tests-dataset.php  2024-10-20 13:11:24 UTC (rev 59259)
+++ trunk/tests/phpunit/tests/fonts/font-face/wp-font-face-tests-dataset.php    2024-10-20 23:23:11 UTC (rev 59260)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -403,4 +403,95 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                return $data;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       public static function get_custom_style_variations( $key = '' ) {
+               static $data = null;
+
+               $path                   = get_stylesheet_directory() . '/assets/fonts/';
+               $uri                    = get_stylesheet_directory_uri() . '/assets/fonts/';
+               $expected_font_families = array(
+                       array(
+                               array(
+                                       'src'          => array(
+                                               "{$path}dm-sans/DMSans-Regular.woff2",
+                                       ),
+                                       'font-family'  => 'DM Sans',
+                                       'font-stretch' => 'normal',
+                                       'font-style'   => 'normal',
+                                       'font-weight'  => '400',
+                               ),
+                               array(
+                                       'src'          => array(
+                                               "{$path}dm-sans/DMSans-Bold.woff2",
+                                       ),
+                                       'font-family'  => 'DM Sans',
+                                       'font-stretch' => 'normal',
+                                       'font-style'   => 'normal',
+                                       'font-weight'  => '700',
+                               ),
+                       ),
+                       array(
+                               array(
+                                       'src'          => array(
+                                               "{$path}open-sans/OpenSans-VariableFont_wdth,wght.ttf",
+                                       ),
+                                       'font-family'  => 'Open Sans',
+                                       'font-stretch' => 'normal',
+                                       'font-style'   => 'normal',
+                                       'font-weight'  => '400',
+                               ),
+                               array(
+                                       'src'          => array(
+                                               "{$path}open-sans/OpenSans-Italic-VariableFont_wdth,wght.ttf",
+                                       ),
+                                       'font-family'  => 'Open Sans',
+                                       'font-stretch' => 'normal',
+                                       'font-style'   => 'italic',
+                                       'font-weight'  => '400',
+                               ),
+                       ),
+                       array(
+                               array(
+                                       'src'          => array(
+                                               "{$path}dm-sans/DMSans-Medium.woff2",
+                                       ),
+                                       'font-family'  => 'DM Sans',
+                                       'font-stretch' => 'normal',
+                                       'font-style'   => 'normal',
+                                       'font-weight'  => '500',
+                               ),
+                               array(
+                                       'src'          => array(
+                                               "{$path}dm-sans/DMSans-Medium-Italic.woff2",
+                                       ),
+                                       'font-family'  => 'DM Sans',
+                                       'font-stretch' => 'normal',
+                                       'font-style'   => 'italic',
+                                       'font-weight'  => '500',
+                               ),
+                       ),
+               );
+
+               $expected_styles = <<<CSS
+@font-face{font-family:"DM Sans";font-style:normal;font-weight:400;font-display:fallback;src:url('{$uri}dm-sans/DMSans-Regular.woff2') format('woff2');font-stretch:normal;}
+@font-face{font-family:"DM Sans";font-style:normal;font-weight:700;font-display:fallback;src:url('{$uri}dm-sans/DMSans-Bold.woff2') format('woff2');font-stretch:normal;}
+@font-face{font-family:"Open Sans";font-style:normal;font-weight:400;font-display:fallback;src:url('{$uri}open-sans/OpenSans-VariableFont_wdth,wght.ttf') format('truetype');font-stretch:normal;}
+@font-face{font-family:"Open Sans";font-style:italic;font-weight:400;font-display:fallback;src:url('{$uri}open-sans/OpenSans-Italic-VariableFont_wdth,wght.ttf') format('truetype');font-stretch:normal;}
+@font-face{font-family:"DM Sans";font-style:normal;font-weight:500;font-display:fallback;src:url('{$uri}dm-sans/DMSans-Medium.woff2') format('woff2');font-stretch:normal;}
+@font-face{font-family:"DM Sans";font-style:italic;font-weight:500;font-display:fallback;src:url('{$uri}dm-sans/DMSans-Medium-Italic.woff2') format('woff2');font-stretch:normal;}
+CSS;
+
+               if ( null === $data ) {
+                       $data = array(
+                               'expected'        => $expected_font_families,
+                               'expected_styles' => $expected_styles,
+                       );
+               }
+
+               if ( isset( $data[ $key ] ) ) {
+                       return $data[ $key ];
+               }
+
+               return $data;
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsfontsfontfacewpFontFaceResolvergetFontsFromStyleVariationsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/fonts/font-face/wpFontFaceResolver/getFontsFromStyleVariations.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/fonts/font-face/wpFontFaceResolver/getFontsFromStyleVariations.php                              (rev 0)
+++ trunk/tests/phpunit/tests/fonts/font-face/wpFontFaceResolver/getFontsFromStyleVariations.php        2024-10-20 23:23:11 UTC (rev 59260)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,71 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Test case for WP_Font_Face_Resolver::get_fonts_from_style_variations().
+ *
+ * @package    WordPress
+ * @subpackage Fonts
+ *
+ * @since 6.7.0
+ *
+ * @group fonts
+ * @group fontface
+ *
+ * @covers WP_Font_Face_Resolver::get_fonts_from_style_variations
+ */
+class Tests_Fonts_WPFontFaceResolver_GetFontsFromStyleVariations extends WP_Font_Face_UnitTestCase {
+       const FONTS_THEME = 'fonts-block-theme';
+
+       public static function set_up_before_class() {
+               self::$requires_switch_theme_fixtures = true;
+
+               parent::set_up_before_class();
+       }
+
+       /**
+        * Ensure that an empty array is returned when the theme has no style variations.
+        *
+        * @ticket 62231
+        */
+       public function test_should_return_empty_array_when_theme_has_no_style_variations() {
+               switch_theme( 'block-theme' );
+
+               $fonts = WP_Font_Face_Resolver::get_fonts_from_style_variations();
+               $this->assertIsArray( $fonts, 'Should return an array data type' );
+               $this->assertEmpty( $fonts, 'Should return an empty array' );
+       }
+
+       /**
+        * Ensure that all variations are loaded from a theme.
+        *
+        * @ticket 62231
+        */
+       public function test_should_return_all_fonts_from_all_style_variations() {
+               switch_theme( static::FONTS_THEME );
+
+               $actual   = WP_Font_Face_Resolver::get_fonts_from_style_variations();
+               $expected = self::get_custom_style_variations( 'expected' );
+
+               $this->assertSame( $expected, $actual, 'All the fonts from the theme variations should be returned.' );
+       }
+
+       /**
+        * Ensure that file:./ is replaced in the src list.
+        *
+        * @ticket 62231
+        */
+       public function test_should_replace_src_file_placeholder() {
+               switch_theme( static::FONTS_THEME );
+
+               $fonts = WP_Font_Face_Resolver::get_fonts_from_style_variations();
+
+               // Check that the there is no theme relative url in the src list.
+               foreach ( $fonts as $family ) {
+                       foreach ( $family as $font ) {
+                               foreach ( $font['src'] as $src ) {
+                                       $src_basename = basename( $src );
+                                       $this->assertStringNotContainsString( 'file:./', $src, "Font $src_basename should not contain the 'file:./' placeholder" );
+                               }
+                       }
+               }
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/fonts/font-face/wpFontFaceResolver/getFontsFromStyleVariations.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsfontsfontfacewpPrintFontFacesFromStyleVariationsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php                         (rev 0)
+++ trunk/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php   2024-10-20 23:23:11 UTC (rev 59260)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,54 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Test case for wp_print_font_faces_from_style_variations().
+ *
+ * @package    WordPress
+ * @subpackage Fonts
+ *
+ * @since 6.7.0
+ *
+ * @group fonts
+ * @group fontface
+ *
+ * @covers wp_print_font_faces_from_style_variations
+ */
+class Tests_Fonts_WpPrintFontFacesFromStyleVariations extends WP_Font_Face_UnitTestCase {
+       const FONTS_THEME = 'fonts-block-theme';
+
+       public static function set_up_before_class() {
+               parent::set_up_before_class();
+               self::$requires_switch_theme_fixtures = true;
+       }
+
+       /**
+        * Ensure that no fonts are printed when the theme has no fonts.
+        *
+        * @ticket 62231
+        */
+       public function test_should_not_print_when_no_fonts() {
+               switch_theme( 'block-theme' );
+
+               $this->expectOutputString( '' );
+               wp_print_font_faces_from_style_variations();
+       }
+
+       /**
+        * Ensure that all fonts are printed from the theme style variations.
+        *
+        * @ticket 62231
+        */
+       public function test_should_print_fonts_in_style_variations() {
+               switch_theme( static::FONTS_THEME );
+
+               $expected        = $this->get_custom_style_variations( 'expected_styles' );
+               $expected_output = $this->get_expected_styles_output( $expected );
+
+               $this->expectOutputString( $expected_output );
+               wp_print_font_faces_from_style_variations();
+       }
+
+       private function get_expected_styles_output( $styles ) {
+               $style_element = "<style class='wp-fonts-local' type='text/css'>\n%s\n</style>\n";
+               return sprintf( $style_element, $styles );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/fonts/font-face/wpPrintFontFacesFromStyleVariations.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>

</body>
</html>