jodit icon indicating copy to clipboard operation
jodit copied to clipboard

How to set the default font size in editor

Open basementmedia2 opened this issue 3 years ago • 4 comments

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

basementmedia2 avatar Oct 29 '20 07:10 basementmedia2

+1

TJX666666 avatar Nov 06 '20 08:11 TJX666666

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

TJX666666 avatar Nov 06 '20 08:11 TJX666666

@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?

Ankit-42-student avatar Feb 16 '23 17:02 Ankit-42-student

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,
};

Lewoaragao avatar Aug 26 '23 12:08 Lewoaragao