quill/ngx-quill设置自定义字体不生效

看到这,想必能搜的也都搜了,话不多说,上代码

import * as QuillNamespace from 'quill';
const Quill: any = QuillNamespace;
fonts = [
  'serif',
  'monospace',
  'SimSun',
  'FangSong',
  'SimHei',
  'KaiTi',
  'Microsoft-YaHei',
  'Arial',
  'Arial Black',
  'Comic Sons MS',
  'Courier New',
  'System',
  'Tahoma',
  'Verdana'
];
  const Font = Quill.import('attributors/style/font');
  Font.whitelist = this.fonts;
  Quill.register(Font, true);

这样就把自定义字体注册进去了。后面不多说了。

参考链接:Custom fonts · Issue #137 · KillerCodeMonkey/ngx-quill · GitHub

javascript – How to add font types on Quill js with toolbar options? – Stack Overflow

    原文作者:lenonrade
    原文地址: https://blog.csdn.net/catchaobject/article/details/123071939
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞