How to add a new font in tinymce editor?

后端 未结 4 1236
甜味超标
甜味超标 2021-01-01 13:47

I want to add new font in tinymce editor which are display in font dropdown and apply to editor text.

I try to add ttf font in

4条回答
  •  隐瞒了意图╮
    2021-01-01 14:33

    I solved the issue,

    Check all the possible issues below and fix them to add a font in TinyMCE editor.

    • Create fonts folder : tinymce/themes/advanced/ - if not exists.

      1. Put font in fonts "tinymce/themes/advanced/fonts/aphrodite_pro.ttf.
      2. Add font in editor_template.js & editor_template_src.js include in "theme_advanced_fonts"

        Ex: theme_advanced_fonts: "Aphrodite Pro=aphrodite pro",

    • Maintain "theme_advanced_fonts" font name sequence in above both js files.

    Most important part: "Aphrodite Pro" name is defined by us where "aphrodite pro" is the name of the font.

    Note this might not work in TinyMCE version 4 or higher. Check new documentation: https://www.tinymce.com/docs/configure/content-formatting/#font_formats

提交回复
热议问题