从 textboxio 中删除字体

Removing fonts from textboxio

天哪,Textboxio,

如何在不删除颜色、突出显示和字体大小的情况下从工具栏中删除字体 ui?

如果无法删除,我只想显示以下字体...

{ "value" : "Arial", "display" : "Arial" },
{ "value" : "Arial Black", "display" : "Arial Black" },
{ "value" : "Arial Narrow", "display" : "Arial Narrow" },
{ "value" : "Helvetica", "display" : "Helvetica" },
{ "value" : "Impact", "display" : "Impact" },
{ "value" : "Lucida Grande", "display" : "Lucida Grande" },
{ "value" : "Tahoma", "display" : "Tahoma" },
{ "value" : "Trebuchet MS", "display" : "Trebuchet MS" },
{ "value" : "Verdana", "display" : "Verdana" },
{ "value" : "Courier New", "display" : "Courier New" },
{ "value" : "Georgia", "display" : "Georgia" },
{ "value" : "Palatino Linotype", "display" : "Palatino Linotype" },
{ "value" : "Times New Roman", "display" : "Times New Roman" },
{ "value" : "Century Gothic", "display" : "Century Gothic" }

在我从 ephox 得到修复之前,我将从插件中分离字体。

我们没有 API 来配置字体列表(还)。您可以创建一个看起来相同的新菜单,但您将无法访问我们将来所做的更改(sup/sub/strike 已添加到 1.2)。

我们的 Changing the toolbar article and the specific toolbar config 文档中提供了更多信息,但此配置可以做到:

var customFontMenu = {
  id    : 'font',
  label : 'Font Menu', // note this is not translated, the real menu is
  items : [ 'font-size', 'font-color', 'superscript', 'subscript', 'strikethrough' ]
};

var config = {
  ui : {
    toolbar : {
      items : ['undo', 'insert', 'style', 'emphasis', 'align', 'listindent', [ customFontMenu, 'removeformat' ], 'tools' ]
    }
  }
};

var editor = textboxio.replace('#targetId', config);

我还建议在我们的 support system 中记录一个票证,这样我们就可以将您的名字添加到字体列表可配置性任务中。

字体自定义已包含在我们的 1.3 版中:

http://docs.ephox.com/display/tbio/fonts