2

我在 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"
                    });

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

4

2 回答 2

1

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

我不是这方面的专家,但一直在寻找另一个问题,并在向 TinyMCE 字体选项添加新字体时遇到了这个问题

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

于 2013-06-22T13:53:01.773 回答
0

我猜,这个字体没有加载到你的编辑器 iframe 中。为了加载此字体,使用 content_css tinymce 配置参数添加以下代码(根据您的需要进行修改)。

@font-face {
    font-family: "your_font";
    font-style:  normal;
    font-weight: normal;
    src: url("http://your_server/font_directory/your_font.ttf");
}
于 2013-04-24T08:35:12.957 回答