Text not using the font when editing in TinyMce

Re: Text not using the font when editing in TinyMce

by Russell England -
Number of replies: 0
Picture of Plugin developers

Fantastic!!! Thank you so much for your help!!!

I had already tried putting the fonts into editor.css but it looks like $contentcss is using the editor.css in the base theme for the editor rather than the current theme.

I did this in /lib/editor/tinymce/lib.php  in function get_init_params()

        $contentcss .= ', /theme/mytheme/style/fonts.css';
        $fontselectlist .= ';Aka Dora=akaDora';

And in /theme/mytheme/style/fonts.css

@font-face {
    font-family:'akaDora';
    src:url('/theme/mytheme/fonts/akaDora.eot') format('eot'),
        url('/theme/mytheme/fonts/akaDora.woff') format('woff'),
        url('/theme/mytheme/fonts/akaDora.ttf') format('truetype'),
        url('/theme/mytheme/fonts/akaDora.svg#akaDora') format('svg');
    font-weight:normal;
    font-style:normal;
}

Purged the caches and it works! :D

I still need the @font-face in /theme/mytheme/style/custom.css too so the content is displayed correctly but I'm just thankful to get it working ;)