I have use the following code to set default font and font size in CKEditor 4:
config.font_defaultLabel = 'Tahoma';
config.fontSize_defaultLabel = '24px';
But above code is not working on Mozilla Firefox.
I have use the following code to set default font and font size in CKEditor 4:
config.font_defaultLabel = 'Tahoma';
config.fontSize_defaultLabel = '24px';
But above code is not working on Mozilla Firefox.
I changed the font-size and font-family using below,
CKEDITOR.addCss(".cke_editable{cursor:text; font-size: 14px; font-family: Arial, sans-serif;}");
v4.11
–
Sectionalize This is a complicated issue. Those settings only set the label in dropdown meaning if there will be a font which doesn't match any defined in font dropdown or there will be no font defined then Tahoma will be shown in the dropdown (there doesn't have to be a match). Labels don't force particular font in the editor.
If you want to have Tahoma as default font, you need to set it in CSS. For classic editor you need to set it in ckeditor/contents.css
for body
element. For inline editor, you need to set it in main page CSS file.
NOTE: There are ways to force particular fixed set of fonts inside the editor (even when pasting different fonts from external resources) but they require usage of Advanced Content Filter (ACF) and transformations. If you wish to learn more about ACF please see below links:
Basically, with addTransformations
method, you can check all the spans
and see if the font used for it is on the list of defined fonts or not. If it is not, you can either delete it or apply default Tahoma font. Please also note that ACF can't be disabled if you want to use transforrmations.
© 2022 - 2024 — McMap. All rights reserved.