antfu / drauu

Headless SVG-based drawboard in browser.
https://drauu.netlify.app/
MIT License
1.2k stars 64 forks source link

feat: add text support #27

Open ProsperBao opened 1 year ago

ProsperBao commented 1 year ago

I think as an SVG-based drawing tool in the browser, it should support adding text.

antfu commented 1 year ago

Thanks! However, I think it's a pretty complex tool to implement right and provide good UX. I feel the current implementation still has a lot to improve, while honestly, it feels a bit out-of-scope. I guess it might be better to implement that in the userland? I don't really want to absorb and maintain this complexity.

ProsperBao commented 1 year ago

Thanks! However, I think it's a pretty complex tool to implement right and provide good UX. I feel the current implementation still has a lot to improve, while honestly, it feels a bit out-of-scope. I guess it might be better to implement that in the userland? I don't really want to absorb and maintain this complexity.

Actually, my initial goal was to support the addition of text functionality in an annotation project. I couldn't find any configuration options, so I thought about adding a feature myself. Alternatively, we could add the ability to import a custom module configuration from external sources. This would allow users to add a module according to their own preferences.

antfu commented 1 year ago

we could add the ability to import a custom module configuration from external sources. This would allow users to add a module according to their own preferences.

Yeah I think that's the best approach. Feel free to go to that direction (and we could move the text model you have there to the playground as an example)

ProsperBao commented 1 year ago

Yeah

let me try.

ProsperBao commented 1 year ago

I think there is still a slight issue. I am unsure how to modify the type of DrawingMode without overriding the original type. My idea is to concatenate the keys based on options.models. However, it seems like this approach would require a lot of type inference.