Skip to content

Commit

Permalink
Merge branch 'trunk' of https://github.com/WordPress/gutenberg into t…
Browse files Browse the repository at this point in the history
…rac-58664
  • Loading branch information
westonruter committed Sep 20, 2023
2 parents b5f51a5 + 1873738 commit 721d2b4
Show file tree
Hide file tree
Showing 269 changed files with 58,421 additions and 594 deletions.
471 changes: 471 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality.
* Requires at least: 6.2
* Requires PHP: 7.0
* Version: 16.6.0
* Version: 16.7.0-rc.1
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ private static function parse_settings( array $settings ) {
foreach ( $settings['typography']['fontFamilies'] as $font_families ) {
foreach ( $font_families as $definition ) {

// Skip if font-family "name" is not defined.
if ( empty( $definition['name'] ) ) {
continue;
}
// // Skip if font-family "name" is not defined.
// if ( empty( $definition['name'] ) ) {
// continue;
// }

// Skip if "fontFace" is not defined, meaning there are no variations.
if ( empty( $definition['fontFace'] ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function get_data() {
return new WP_Error( 'font_collection_file_error', __( 'Font Collection data JSON file does not exist.', 'gutenberg' ) );
}

$data = file_get_contents( $this->config['data_json_file'] );
$data = wp_json_file_decode( $this->config['data_json_file'], array( 'associative' => true ) );
if ( empty( $data ) ) {
return new WP_Error( 'font_collection_read_error', __( 'Error reading the Font Collection data JSON file contents.', 'gutenberg' ) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ public function install( $files = null ) {
add_filter( 'upload_dir', array( 'WP_Font_Library', 'set_upload_dir' ) );
$were_assets_written = $this->download_or_move_font_faces( $files );
remove_filter( 'upload_dir', array( 'WP_Font_Library', 'set_upload_dir' ) );
remove_filter( 'upload_mimes', array( 'WP_Font_Library', 'set_allowed_mime_types' ) );

if ( ! $were_assets_written ) {
return new WP_Error(
Expand Down
55,714 changes: 55,714 additions & 0 deletions lib/experimental/fonts/font-library/default-font-collection.json

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion lib/experimental/fonts/font-library/font-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,18 @@ function wp_register_font_collection( $config ) {
}
}

// @core-merge: This code needs to be removed.
add_action(
'enqueue_block_editor_assets',
function () {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalFontLibrary = true', 'before' );
}
);

$default_font_collection = array(
'id' => 'default-font-collection',
'name' => 'Google Fonts',
'description' => __( 'Add from Google Fonts. Fonts are copied to and served from your site.', 'gutenberg' ),
'data_json_file' => path_join( __DIR__, 'default-font-collection.json' ),
);

wp_register_font_collection( $default_font_collection );
Loading

0 comments on commit 721d2b4

Please sign in to comment.