Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add textbox to canvas #8

Open
stefanrehm opened this issue Jun 8, 2021 · 4 comments
Open

Add textbox to canvas #8

stefanrehm opened this issue Jun 8, 2021 · 4 comments

Comments

@stefanrehm
Copy link

Hi there, amazing tool!

Would it be possible to add "textboxes" to the Canvas so that I can also write text?

Thanks!

@fmeringdal
Copy link
Owner

Sure, that should be quite easy to add. I will try to find some time within one or two weeks to add this.
Or if you would like to make a shot at adding this feature yourself, I could write up a detailed issue for you? :)

@stefanrehm
Copy link
Author

That would be awesome. If I could, I would love to do that. But, unfortunately, I cant... :/

@clarissalimab
Copy link

Hey @fmeringdal! I'd like to give it a try, but I don't know how to start. Can you help me with this one? 🙂

@fmeringdal
Copy link
Owner

@clarissalimab That is awesome, this will be a great improvement!

This is what I think needs to be done first:

  1. Update the canvas toolsbar file to include a "insert text button". This should when clicked call the canvasManager.insertText method which you will need to create.
  2. Update the canvas manager file
    Create a public insertText method (similar to the insertImage method), this should create a fabric.IText object and add it to the canvas this.addObject(textObject, true).

It might also be useful to read up on fabric.js library which is what we are using in the canvas.

There will be some more things that will be needed, but I think this is enough to get you started :)
Let me know if something is unclear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants