Tiny MCE and @font-face
I need to use an exotic font with tiny_mce, I edited the theme_advanced_fonts property and I am using the content_css property to link an stylesheets that defines my font family开发者_如何学Python.
I can select the font from the menu but text is not displayed with that, so I have to edit the source html and the style property for the text to be rendered with the fontface I want.
Thats not a nice thing to ask to my clients.
What can I do?
I suggest you write your own plugin using a dropdown select list and updating the iframes head with the newly choosen css (font).
The code to set the css could look liek
iframe_id = ed.id;
with(document.getElementById(iframe_id).contentWindow){
var h=document.getElementsByTagName("head");
var newStyleSheet=document.createElement("link");
newStyleSheet.rel="stylesheet";
newStyleSheet.href="http:myerver.com/css/my.css";
h[0].appendChild(newStyleSheet);
}
精彩评论