• User

    Come aggiungere nuovi @font-face in tinyMCE Advance

    Un saluto a tutti. Sto impazzendo nel cercare come aggiungere un @font-face Kit di un nuovo font preso da fontsquirrel in tinyMCE Advance . Cercando in rete ho trovato un sacco di guide ma che non mi hanno portato da nessuna parte. Al momento ho aggiunto nel style.css del tema questo dopo aver inserito i relativi file del font nella cartella font del mio tema wordpress.

    @font-face {

    font-family: 'existencestencil_light';
    
    src: url('font/Existence-StencilLight-webfont.eot');
    
    src: url('font/Existence-StencilLight-webfont.eot?#iefix') format('embedded-opentype'),
    
         url('font/Existence-StencilLight-webfont.woff') format('woff'),
    
         url('font/Existence-StencilLight-webfont.ttf') format('truetype'),
    
         url('font/Existence-StencilLight-webfont.svg#existencestencil_light') format('svg');
    
    font-weight: normal;
    
    font-style: normal;
    

    }

    fatto questo sono andato ad inserire la seguente funzione in functions.php

    // Add custom Fonts to the Fonts list
    if ( ! function_exists( 'wpex_mce_fonts_array' ) ) {
    function wpex_mce_fonts_array( $initArray ) {
    $initArray = 'Existencestencil=existencestencil_light;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Wingdings=wingdings,zapf dingbats';
    return $initArray;
    }
    }
    add_filter( 'tiny_mce_before_init', 'wpex_mce_fonts_array' );

    Questa funzione mi ha permesso di vedere in tinyMCE tra i vari font anche quello da me aggiunto ovvero existencestencil_light ma qunado vado a selezionare un testo e cerco di cambiare font questo cambia in un font che non è quello che ho caricato ed anche nell'anteprima della finestra dropdown non c'è il font che ho messo.Spero che voi abbiate qualche suggerimento perchè non so più dove sbattere la testa.
    Grazie in anticipo per qualsiasi aiuto.