我已经查看了这个帖子:谷歌字体和TinyMCE,事实上以前甚至成功地为用户添加了新字体到TinyMCE字体选项.
但我不确定这里出了什么问题以及为什么我不能再这样做了.我正在尝试添加一个新字体,Samman我刚从MyFonts.com获得.
在我的TinyMCE初始化中,我包括:
content_css : "css/fonts.css,css/userdesigntool.css,http://fonts.googleapis.com/css?family=Paytone+One,http://fonts.googleapis.com/css?family=Aclonica",
Run Code Online (Sandbox Code Playgroud)
css/fonts.css是我描述新字体的地方.在这个文件中,我刚刚保存在fonts/css我服务器上的文件夹中的新字体如下所示:
@font-face {
font-family: 'sammanregular';
src: url('fonts/samman/samman-webfont.eot');
src: url('fonts/samman/samman-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/samman/samman-webfont.woff') format('woff'),
url('fonts/samman/samman-webfont.ttf') format('truetype'),
url('fonts/samman/samman-webfont.svg#sammanregular') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
我从Font-Squirrel中获得了这些(因为我之前已成功完成其他字体),并且我已经仔细检查以确保文件实际上在预期的路径上,并且它们是.
在theme_advanced_fontsTinyMCE初始化的条目中,我有这个:
theme_advanced_fonts : tm_fonts,
// some more stuff below
Run Code Online (Sandbox Code Playgroud)
tm_fonts我的javascript中描述的变量在哪里:
var tm_fonts = "Andale Mono=andale mono,times;"+
"Arial=arial,helvetica,sans-serif;"+
"Arial Black=arial black,avant garde;"+
"Book Antiqua=book_antiquaregular,palatino;"+
"Corda Light=CordaLight,sans-serif;"+
"Courier New=courier_newregular,courier;"+
"Flexo Caps=FlexoCapsDEMORegular;"+
"Lucida Console=lucida_consoleregular,courier;"+
"Georgia=georgia,palatino;"+
"Helvetica=helvetica;"+
"Impact=impactregular,chicago;"+
"Museo Slab=MuseoSlab500Regular,sans-serif;"+
"Museo Sans=MuseoSans500Regular,sans-serif;"+
"Oblik Bold=OblikBoldRegular;"+
"Sofia Pro …Run Code Online (Sandbox Code Playgroud)