0

Hi I need to add Kruti Dev 010 font to my CKEditor. I have downloaded font and added its font face to my content.css file of ckeditor. In ckeditor.config.js file, I have added this line :

 config.font_names = 'Kruti Dev 010/"Kruti_Dev_010";' + config.font_names;

and it is working fine (I can add hindi font). But problem comes when I copy this text to word file then english font are appearing instead of Krutidev font, Because word need font family like:

<span style="font-family:&quot;Kruti Dev 010&quot;">

and my font family is "kruti_dev_010".

So I tried to change font name in ckeditor.config.js as :

config.font_names = 'Kruti Dev 010/"Kruti Dev 010";' + config.font_names;

But it is not working and I think numeric character with spaces in font name are causing problem. same problem is coming with DevLys 010 font.

Any help is much appreciated.

Thanks

subu.purohit
  • 33
  • 1
  • 9

2 Answers2

0

You could add another div and button external to the CkEditor instance. When you click the button, it takes the editor contents , replaces "Kruti_Dev_010" with "Kruti Dev 010" and puts the updated content in the div. Then you copy the contents of the div into the word doc.

$("#button").click(function() {
    var editorContent = CKEDITOR.instances['TextAreaID'].getData();
    editorContent.replace('Kruti_Dev_010', 'Kruti Dev 010');
    $('#divForWord').html(editorContent);
});

If you want the HTML tags to be displayed in the div rather than rendered, use .text rather than .html, like this:

$('#divForWord').text(editorContent);
codewaggle
  • 4,893
  • 2
  • 32
  • 48
0

You could add another div and button external to the CkEditor instance. When you click the button, it takes the editor contents , replaces "Kruti_Dev_010" with "Kruti Dev 010" and puts the updated content in the div. Then you copy the contents of the div into the word doc.


    $("#button").click(function() {
    var editorContent = CKEDITOR.instances['TextAreaID'].getData();
    editorContent.replace('Kruti_Dev_010', 'Kruti Dev 010');
    $('#divForWord').html(editorContent);
});

lalit mohan
  • 193
  • 1
  • 12