如何阻止 tinyMCE 获取字体选择的页面字体?

How do I block tinyMCE from getting the page font for the font-selection?

我有这个基本的 tinyMCE 配置。

tinymce.init({
  selector: '#editor',
  inline: true,
  fixed_toolbar_container: '#toolbar',
  menubar: false,
  statusbar: false,
  plugins: 'textcolor autolink link code',
  toolbar: ['fontselect', 'fontsizeselect'],
  font_formats: "Sans-serif=sans-serif;Serif=serif;Monospace=monospace",
  fontsize_formats: "Piccolo=12px Normale=14px Grande=16px Molto-grande=24px"
})

如您所见,我将其配置为使用 3 种字体:sans、serif 和 mono。

问题是 tinyMCE 使用其嵌入页面的 Roboto 字体初始化自身,即使该字体不在列表中。我怎样才能避免这种情况??

https://codepen.io/anon/pen/rqyNzL

当您使用内联模式时,这是按设计工作的。来自文档:

Most significantly, when using inline editing TinyMCE is not isolated from the page by being encapsulated within an iframe. This has the advantage of ensuring that the content within the editor inherits the surrounding page's styles when presenting the content.

Since the editor is not sandboxed in an iframe in inline editing mode, CSS styles for the editor's content are inherited from the page that the editor is on. This feature allows you to edit content exactly as it appears within the context of the page, providing a true WYSIWYG editing experience.

https://www.tiny.cloud/docs/general-configuration-guide/use-tinymce-inline/