scaleflex / filerobot-image-editor

Edit, resize, and filter any image! Any questions or issues, please report to https://github.com/scaleflex/filerobot-image-editor/issues
MIT License
1.35k stars 343 forks source link

How to add custom fonts in React/Next JS for the editor - Question #417

Closed satishgunasekaran closed 10 months ago

satishgunasekaran commented 10 months ago

<FilerobotImageEditor

      theme={
        {
          palette: {
            'bg-primary-active': '#ECF3FF'
          },
          typography: {
            fontFamily: roboto
          }
        }
      }
      // @ts-ignore
      loadableDesignState={uploadedDesignState}
      source={imageSource}
      onSave={(editedImageObject, designState) => {
        onSave(editedImageObject, designState);
      }}

      onClose={closeImgEditor}
      annotationsCommon={{
        fill: '#ff0000'
      }}
      Text={{ text: 'Filerobot...',
        fonts: [
          { label: 'Arial', value: 'Arial' },
          // 'Tahoma',
          'Sans-serif',
          'Serif',
          'Times New Roman',
          'Monospace',
          { label: 'Comic Sans', value: 'Comic-sans' },
        ],
      }}

      I was able to do it through this