我很想知道如何在TinyMCE编辑器中使用braillie字体 . 目前,我想在Moodle中集成此功能,使用TinyMCE作为默认编辑器 .
我可以添加字体到tinymce的唯一方法是编辑核心代码 .
首先将您的字体文件复制到 /theme/yourtheme/fonts/
/theme/yourtheme/fonts/
在 /theme/yourtheme/style/fonts.css 中为您的字体创建一个css文件
/theme/yourtheme/style/fonts.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 中,以便正确显示字体 .
/theme/yourtheme/style/custom.css
编辑 /lib/editor/tinymce/lib.php 并在 $fontselectlist = empty($config->fontselectlist) ? '' : $config->fontselectlist; 行之后将这两行添加到 function get_init_params() (这是在Moodle 2.5中)
/lib/editor/tinymce/lib.php
$fontselectlist = empty($config->fontselectlist) ? '' : $config->fontselectlist;
function get_init_params()
$contentcss .= ', /theme/yourtheme/style/fonts.css'; $fontselectlist .= ';Your font=yourfont';
清除缓存 /admin/purgecaches.php 刷新浏览器,字体应该在那里 .
/admin/purgecaches.php
1 回答
我可以添加字体到tinymce的唯一方法是编辑核心代码 .
首先将您的字体文件复制到
/theme/yourtheme/fonts/
在
/theme/yourtheme/style/fonts.css
中为您的字体创建一个css文件您还需要将上面的@ 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中)清除缓存
/admin/purgecaches.php
刷新浏览器,字体应该在那里 .