diff --git a/projects/plugins/jetpack/changelog/DOTTHEM-52-macronized-vowels-not-rendering-correctly-when-libre-baskerville-is b/projects/plugins/jetpack/changelog/DOTTHEM-52-macronized-vowels-not-rendering-correctly-when-libre-baskerville-is new file mode 100644 index 0000000000000..ab8f3c314b63b --- /dev/null +++ b/projects/plugins/jetpack/changelog/DOTTHEM-52-macronized-vowels-not-rendering-correctly-when-libre-baskerville-is @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Import the fonts selected as default on the customizer. diff --git a/projects/plugins/jetpack/modules/google-fonts/current/class-jetpack-google-font-face.php b/projects/plugins/jetpack/modules/google-fonts/current/class-jetpack-google-font-face.php index 5293c56bb2f51..01a40fbad75b0 100644 --- a/projects/plugins/jetpack/modules/google-fonts/current/class-jetpack-google-font-face.php +++ b/projects/plugins/jetpack/modules/google-fonts/current/class-jetpack-google-font-face.php @@ -66,6 +66,7 @@ public function print_font_faces() { $fonts_to_print = array(); $this->collect_global_styles_fonts(); + $this->collect_selected_fonts(); $fonts_in_use = array_values( array_unique( $this->fonts_in_use, SORT_STRING ) ); $fonts_in_use = array_map( function ( $font_slug ) use ( $font_slug_aliases ) { @@ -86,6 +87,30 @@ function ( $font_slug ) use ( $font_slug_aliases ) { } } + /** + * Collect fonts selected in the Jetpack Fonts module. + */ + public function collect_selected_fonts() { + if ( ! class_exists( '\Jetpack_Fonts' ) ) { + return; + } + + $jetpack_fonts_instance = \Jetpack_Fonts::get_instance(); + + $selected_fonts = array_unique( + array_map( + function ( $font ) { + return $this->format_font( $font['cssName'] ); + }, + (array) $jetpack_fonts_instance->get( 'selected_fonts' ) + ) + ); + + foreach ( $selected_fonts as $font_slug ) { + $this->add_font( $font_slug ); + } + } + /** * Collect fonts used for global styles settings. */