首页 文章

在TinyMCE编辑器中使用Braillie Font

提问于
浏览
0

我很想知道如何在TinyMCE编辑器中使用braillie字体 . 目前,我想在Moodle中集成此功能,使用TinyMCE作为默认编辑器 .

1 回答

  • 0

    我可以添加字体到tinymce的唯一方法是编辑核心代码 .

    首先将您的字体文件复制到 /theme/yourtheme/fonts/

    /theme/yourtheme/style/fonts.css 中为您的字体创建一个css文件

    @font-face {
        font-family:'yourfont';
        src:url('/theme/yourtheme/fonts/yourfont.eot') format('eot'),
            url('/theme/yourtheme/fonts/yourfont.woff') format('woff'),
            url('/theme/yourtheme/fonts/yourfont.ttf') format('truetype'),
            url('/theme/yourtheme/fonts/yourfont.svg#yourfont') format('svg');
        font-weight:normal;
        font-style:normal;
    }
    

    您还需要将上面的@ font-face复制到 /theme/yourtheme/style/custom.css 中,以便正确显示字体 .

    编辑 /lib/editor/tinymce/lib.php 并在 $fontselectlist = empty($config->fontselectlist) ? '' : $config->fontselectlist; 行之后将这两行添加到 function get_init_params() (这是在Moodle 2.5中)

    $contentcss .= ', /theme/yourtheme/style/fonts.css';
        $fontselectlist .= ';Your font=yourfont';
    

    清除缓存 /admin/purgecaches.php 刷新浏览器,字体应该在那里 .

相关问题