[Resolved] Local font not rendering in editor

Home Forums Support [Resolved] Local font not rendering in editor

Home Forums Support Local font not rendering in editor

Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #2122096
    Tom
    Lead Developer
    Lead Developer

    Can you share the code you were using to load local fonts in the editor?

    WordPress 5.9 made it so the enqueue_block_editor_assets no longer loads assets in the tablet/mobile views in the editor, so it’s necessary to use a different method now.

    For example, add the @font-face CSS to a stylesheet and upload it to your child theme, then do this:

    add_filter( 'generate_editor_styles', function( $editor_styles ) {
        $editor_styles[] = 'path/to/fonts/style.css';
    
        return $editor_styles;
    } );
    #2122377
    Elvis

    Sorry,
    must have been late. Today all works fine. My standard admin enqueue method works fine.

    function apuri_localfonts_in_editor(  ) {
    	wp_enqueue_style( 'apuri-type', get_stylesheet_directory_uri() . '/assets/css/apuri-typography.css', false, APURI_VERSION, 'all');
    }
    add_filter( 'admin_enqueue_scripts', 'apuri_localfonts_in_editor');

    I appologize.

Viewing 2 posts - 16 through 17 (of 17 total)
  • You must be logged in to reply to this topic.