To add custom font sizes to the QuillJS editor, you need to define the custom sizes in the toolbarOptions
and ensure that they are supported by QuillJS. Here’s a step-by-step guide to adding custom font sizes:
-
Define the custom font sizes in the
toolbarOptions
array:javascriptlet toolbarOptions = [ ['bold', 'italic', 'underline', 'strike'], [{ 'align': [] }], [{ 'size': ['small', false, 'large', 'huge'] }], // Define the custom sizes here [{ 'color': ['#FFF'] }] ];
-
Initialize the Quill editor with the defined
toolbarOptions
:javascriptthis.editor = new Quill('#executive-control-editor', { modules: { toolbar: toolbarOptions }, theme: 'snow' });
-
In the second approach you provided, ensure that the
ql-size
class is correctly linked to the custom sizes in thetoolbarOptions
.
By following these steps, you should be able to add custom font sizes to the QuillJS editor’s toolbar. If you encounter any issues, make sure to check the QuillJS documentation for the correct implementation of custom sizes.
المزيد من المعلومات
لإضافة أحجام خط مخصصة إلى محرر QuillJS ، يجب عليك تعريف الأحجام المخصصة في مصفوفة toolbarOptions
والتأكد من أنها مدعومة من قبل QuillJS. إليك دليل تفصيلي على كيفية إضافة أحجام الخط المخصصة:
-
قم بتعريف أحجام الخط المخصصة في مصفوفة
toolbarOptions
:javascriptlet toolbarOptions = [ ['bold', 'italic', 'underline', 'strike'], [{ 'align': [] }], [{ 'size': ['small', false, 'large', 'huge'] }], // Define the custom sizes here [{ 'color': ['#FFF'] }] ];
-
قم بتهيئة محرر Quill مع
toolbarOptions
المحددة:javascriptthis.editor = new Quill('#executive-control-editor', { modules: { toolbar: toolbarOptions }, theme: 'snow' });
-
في الطريقة الثانية التي قدمتها ، تأكد من أن الفئة
ql-size
مرتبطة بشكل صحيح بالأحجام المخصصة فيtoolbarOptions
.
من خلال اتباع هذه الخطوات ، يجب أن تكون قادرًا على إضافة أحجام خط مخصصة إلى شريط أدوات محرر QuillJS. إذا واجهت أي مشاكل ، تأكد من التحقق من توثيق QuillJS للتنفيذ الصحيح للأحجام المخصصة.