Angular 将字体族功能添加到角形编辑器工具栏
遗憾的是,我无法将字体系列功能添加到CKEditor的工具栏中 我在控制台中遇到以下错误: 工具栏视图项不可用:请求的工具栏项不可用 不可用的阅读更多: 以下是我的项目的外观: 应用程序模块.tsAngular 将字体族功能添加到角形编辑器工具栏,angular,ckeditor,toolbar,font-family,ckeditor5,Angular,Ckeditor,Toolbar,Font Family,Ckeditor5,遗憾的是,我无法将字体系列功能添加到CKEditor的工具栏中 我在控制台中遇到以下错误: 工具栏视图项不可用:请求的工具栏项不可用 不可用的阅读更多: 以下是我的项目的外观: 应用程序模块.ts ... import { CKEditorModule } from '@ckeditor/ckeditor5-angular'; import { CkeditorComponent } from './ckeditor/ckeditor.component'; ... @NgModule( {
...
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
import { CkeditorComponent } from './ckeditor/ckeditor.component';
...
@NgModule( {
declarations: [
...
CkeditorComponent
],
imports: [
...
CKEditorModule,
...
],
...
} )
import * as BalloonEditor from '@ckeditor/ckeditor5-build-balloon';
@Component( {
...
} )
export class CkeditorComponent {
public Editor = BalloonEditor;
public editorConfig = {
fontFamily: {
options: [
'default',
'Ubuntu, Arial, sans-serif',
'Ubuntu Mono, Courier New, Courier, monospace'
]
},
toolbar: [
'heading', 'bulletedList', 'numberedList', 'fontFamily'
]
};
}
ckeditor.component.ts
...
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
import { CkeditorComponent } from './ckeditor/ckeditor.component';
...
@NgModule( {
declarations: [
...
CkeditorComponent
],
imports: [
...
CKEditorModule,
...
],
...
} )
import * as BalloonEditor from '@ckeditor/ckeditor5-build-balloon';
@Component( {
...
} )
export class CkeditorComponent {
public Editor = BalloonEditor;
public editorConfig = {
fontFamily: {
options: [
'default',
'Ubuntu, Arial, sans-serif',
'Ubuntu Mono, Courier New, Courier, monospace'
]
},
toolbar: [
'heading', 'bulletedList', 'numberedList', 'fontFamily'
]
};
}
ckeditor.component.html
<ckeditor
[editor]="Editor"
[config]="editorConfig"
data="<p>Hello world!</p>"></ckeditor>
正如我在中回答您的那样,不幸的是,
FontFamily
插件没有出现在气球编辑器
构建中。因此,您有两种选择:
FontFamily
插件感谢您的帮助,我开始基于Balloon创建自己的自定义构建。在这里你可以找到我现在卡住的地方:注意:我添加了一个错误日志目录,在里面你可以找到我得到的错误日志。这是因为导入不正确-
import Font from'@ckeditor/ckeditor5 Font'代码>应该是从'@ckeditor/ckeditor5 Font/src/Font'导入字体代码>我们不公开源程序包中的默认入口点,因为它们可能会以不同的方式使用。我已经将修复提交给了,还成功地从GH安装了自定义版本,并导入到我的Angular 6项目中。非常感谢您的帮助,