pixolith / fabricjs-customise-controls-extension

Customise the Icon/Cursor/Action of the fabric.js controls
275 stars 100 forks source link

Support FontAwesome #34

Closed anfen closed 7 years ago

anfen commented 7 years ago

Is it possible to use FontAwesome fonts for icons, rather than image files?

MDSLKTR commented 7 years ago

Hey there. I am afraid this won't work out of the box since it would be too much of a change to the core to accomplish this. What you probably can do though is load the icons onto a canvas with the fabric.js text element and then export the pieces as images dynamically for usage as corner icons.

anfen commented 7 years ago

Thanks for the suggestion. I think I follow, but what do you mean by "export the pieces as images dynamically"?

MDSLKTR commented 7 years ago

Hey again, http://fabricjs.com/docs/fabric.StaticCanvas.html#toDataURL is what i meant by that. Since you can supply top/left values, you should be able to make proper images out of your icons rendered on canvas. The result can then be loaded with this extension as a normal corner icon image.

MDSLKTR commented 7 years ago

Closed because of inactivity. Please re-open if you need further help.