V
V
Vladimir2016-11-15 23:47:36
Drupal
Vladimir, 2016-11-15 23:47:36

Drupal/How to integrate your font into ckeditor?

I'm trying to embed my font from a ttf file into ckeditor, in the search I found only the code provided below, which needs to be saved in the ckeditor.config.js file.

config.contentsCss = '/css/fonts.css';
  //the next line add the new font to the combobox in CKEditor
config.font_names = 'Lobster/lobster;' + config.font_names;

Then I create a fonts.ss file and save the styles in it
@font-face {
    font-family: Lobster; /* Имя шрифта */
    src: url(../fonts/lobster.ttf); /* Путь к файлу со шрифтом */
   }

When editing a material in the drop-down list of fonts, my font is displayed, but the font itself is not connected.
Tell me what could be the problem?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2016-11-15
@seoyuzer

Different browsers understand fonts in different formats, all of them need to be included.
Or like this: https://www.fontsquirrel.com/tools/webfont-generator - put ttf there - get the whole set at the output, put it in the fonts folder, copy the CSS, check the paths to the fonts.
Or like this: https://fonts.google.com/specimen/Lobster download as a set or via import

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question