xdan / jodit

Jodit - Best WYSIWYG Editor for You
https://xdsoft.net/jodit/
MIT License
1.68k stars 352 forks source link

How to set the default font size in editor #541

Open basementmedia2 opened 4 years ago

basementmedia2 commented 4 years ago

Hi,

another little question: Is it possible to set the font-size and the font-family in the wysiwyg-area?

I tried with

<style>
  /*default version*/
  @font-face {
    font-family: 'exo2';
    src: url('../fonts/Exo2-Regular.ttf'); /* IE9 Compat Modes */
    src: 
        local('exo2'),
        local('exo2'), /* Duplicated name with hyphen */
        url('../fonts/Exo2-Regular.ttf') 
        format('truetype');
  }
  .jodit_wysiwyg {
    font-family:exo2;
    font-size:12px;
  }
</style>

but nothing happens.

Best wishes Daniel

TJX666666 commented 3 years ago

+1

TJX666666 commented 3 years ago

just now , I looked at the source code and found a solution :insert base config style: { font: "18px Arial", },

Ankit-42-student commented 1 year ago

@basementmedia2 did @TJX666666 solution work for you? It's not working for me and is there any list present for the style properties for jodit?

Lewoaragao commented 1 year ago

exemplifying how to use it to configure, including in the list of jodit settings this line: style: { font: "18px Arial" },

const config = {
  style: { font: "18px Arial" },
  readonly: false,
  buttons: [
    "bold",
    "italic",
    "underline",
    "strikethrough",
    "eraser",
    "ul",
    "ol",
    "copyformat",
    "paragraph",
    "superscript",
    "subscript",
    "cut",
    "copy",
    "paste",
    "undo",
    "redo",
    "table",
    "lineHeight",
  ],
  toolbarAdaptive: false,
};