nhn / tui.image-editor

🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
http://ui.toast.com/tui-image-editor
MIT License
6.98k stars 1.29k forks source link

fontFamily should be configurable #787

Open OR13 opened 2 years ago

OR13 commented 2 years ago

Version

    "@toast-ui/react-image-editor": "^3.15.2",

Development Environment

macOS / chrome.

Current Behavior

https://github.com/nhn/tui.image-editor/blob/338d7b18b6b6a52962f042e31e46638d88683c4a/apps/image-editor/src/js/action.js#L618

Expected Behavior

Expect to be able to configure font family defaults when editor is initialized.

OR13 commented 2 years ago

I used this work around:

 editor.on("objectActivated", function (props: any) {
        setTimeout(() => {
          if (props.fontFamily !== defaultFontFamily) {
            editor.changeTextStyle(props.id, {
              fontFamily: defaultFontFamily,
            });
          }
        }, 500);
      });
lja1018 commented 2 years ago

@OR13 Is it only added to react-image-editor?

OR13 commented 2 years ago

My work around is only for the editor.

lja1018 commented 2 years ago

@OR13 You mean not only react-image-editor but also image-editor core, right?

OR13 commented 2 years ago

Yes, I think so.

lja1018 commented 2 years ago

@OR13 Thank you for the report. I'll add it to TODO.