2013-04-23 191 views
2

我在tinyMCE上添加了一個新的字體theme_advanced_fonts,但它不起作用。TinyMCE,添加了新的字體無法選擇

所有其他字體的作品,我可以選擇它並看到結果,但與新的字體,如果文本是在這種字體,我看到很好的結果,但我可以在tinyMCE中選擇此字體。

我的代碼是:

$('.screen-textarea').tinymce({ 
         script_url : '<?php echo base_url(); ?>assets/js/tiny_mce/tiny_mce.js', 

         mode : "textareas", 
         theme : "advanced", 
         plugins : "style,inlinepopups", 

         theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,fontselect,fontsizeselect", 
         theme_advanced_buttons2 : "", 
         theme_advanced_toolbar_location : "bottom", 
         theme_advanced_toolbar_align : "left", 
         theme_advanced_statusbar_location : "bottom", 
         theme_advanced_resizing : true, 
         theme_advanced_fonts : "ChildsPlay=ChildsPlay;"+"Academy Engraved LET=Academy Engraved LET;"+"American Typewriter=American Typewriter;"+"Arial=Arial;"+"Bradley Hand=Bradley Hand;"+"Chalkduster=Chalkduster;"+"Copperplate=Copperplate;"+"Courier=Courier;"+"Futura=Futura;"+"Georgia=Georgia;"+"Helvetica Neue=Helvetica Neue;"+"Marker Felt=Marker Felt;"+"Noteworthy=Noteworthy;"+"Optima=Optima;"+"Papyrus=Papyrus;"+"Party LET=Party LET;"+"Snell Roundhand=Snell Roundhand;"+"Times New Roman=Times New Roman;"+"Verdana=Verdana;"+"Sanchez=Sanchez;", 
         theme_advanced_font_sizes : "12px,15px,18px,22px,25px,29px,35px,41px,48px,51px,59px,66px,73px,78px,84px,88px,90px", 
         theme_advanced_text_colors : "C2C2C2,FFFFFF,000000,1c2977" 
        }); 

字體不工作是桑切斯。我的電腦上有這個字體。

回答

0

我想,這種字體並未加載到您的編輯器iframe中。 爲了加載此字體,請使用content_css tinymce config參數添加以下代碼(根據需要進行修改)。

@font-face { 
    font-family: "your_font"; 
    font-style: normal; 
    font-weight: normal; 
    src: url("http://your_server/font_directory/your_font.ttf"); 
} 
1

看看這類問題上的其他帖子,我的印象是分號「;」在你的字體列表的末尾不應該存在 - 它應該結束...... +「桑切斯=桑切斯」不是...... +「桑切斯=桑切斯;」

我對這個東西不是專家,但一直在四處尋找另外一個問題,在Adding new fonts to TinyMCE font options

希望跨越這來了,這是不無關係,並且可能幫助