Removing fonts from textboxio

220 Views Asked by At

Oh holy Textboxio,

How do I remove the font faces from the toolbar ui without removing the color, highlights and font size?

I just want the following fonts to display if it can't be removed...

{ "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" }
3

There are 3 best solutions below

0
On BEST ANSWER

Font customisation has been included with our version 1.3 release:

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

0
On

Until I get a fix from ephox, I'll detach the fonts from the plugin.

0
On

We don't have an API to configure the font list (yet). You can create a new menu that looks the same, but you'll lose access to future changes we make (sup/sub/strike were added in 1.2).

More info is available in our Changing the toolbar article and the specific toolbar config documentation, but this config will do it:

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);

I also suggest logging a ticket in our support system so we can add your name to the font list configurability task.