TinyMCE,添加了新的字体无法选择

时间:2013-04-23 22:38:07

标签: javascript tinymce

我在tinyMCE上添加了一个带有theme_advanced_fonts的新字体,但它不起作用。

所有其他字体都有效,我可以选择它并查看结果但是使用新字体,如果文本是这种字体,我看到效果不错但我可以在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"
                    });

字体不起作用是桑切斯。我的电脑上有这个字体。

2 个答案:

答案 0 :(得分:1)

关于这类问题的其他帖子,我的印象是分号“;”在你的字体列表的末尾不应该存在 - 它应该结束...... +“Sanchez = Sanchez”而不是...... +“Sanchez = Sanchez;”

我不是这方面的专家,但一直在寻找另一个问题并在Adding new fonts to TinyMCE font options发现了这个问题

希望这不是无关紧要的,可能会有所帮助

答案 1 :(得分:0)

我想,您的编辑器iframe中未加载此字体。 为了加载这个字体,使用content_css tinymce config param添加以下代码(根据需要修改)。

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