@font-face added to ckeditors contentsCSS could optionally be inlined in the result html?

77 Views Asked by At

When I use @font-face in the css file that I include with

config.contentsCss = '/Content/CSS/Editor';

having a css file with @font-face

@font-face {
    font-family: myFirstFont;
    src: url(sansation_bold.woff);
    font-weight: bold;
}

and also add the font to the font names like

config.font_names =
        "Arial/Arial, Helvetica, sans-serif;" +
        "Comic Sans MS/Comic Sans MS, cursive;" +
        "Courier New/Courier New, Courier, monospace;" +
        "First font/myFirstFont;";

I will be able to select the font in ckeditors dropdown, however, the resulting html will depend on the same @font-face to be added to the site itself.

Is there some way of telling ckeditor to inline that @font-face declaration in the html that it will produce?

1

There are 1 best solutions below

1
On

Is there some way of telling ckeditor to inline that @font-face declaration in the html that it will produce?

There is, but it does not make sense. You would need to strip that when loading content back to editor or it would become repeated.

Your website's backend should load the same (or similar) stylesheet as you use inside CKEditor.