有什么想法如何使 CKEditor 字体大小组合框可编辑以允许自定义字体大小吗?
或者我如何添加自己的字体大小控件而不是组合框?
例如,我想用输入替换组合框。
最佳答案
我不知道用户输入自定义字体大小的方法,但您可以使用 fontSize_sizes
配置属性来更改向用户显示的默认字体大小。
来自docs :
The list of fonts size to be displayed in the Font Size combo in the toolbar. Entries are separated by semi-colons (';').
Any kind of "CSS like" size can be used, like '12px', '2.3em', '130%', 'larger' or 'x-small'.
A display name may be optionally defined by prefixing the entries with the name and the slash character. For example, 'Bigger Font/14px' will be displayed as 'Bigger Font' in the list, but will be outputted as '14px'.
config.fontSize_sizes = '16/16px;24/24px;48/48px;';
config.fontSize_sizes = '12px;2.3em;130%;larger;x-small';
config.fontSize_sizes = '12 Pixels/12px;Big/2.3em;30 Percent More/130%;Bigger/larger;Very Small/x-small';
关于javascript - CKEditor:使字体大小组合框可编辑或使用新控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40766632/