timjs / elm-collage

Create interactive vector graphics and position them relative to each other
BSD 3-Clause "New" or "Revised" License
58 stars 19 forks source link

Restructure the API for styling text to be more consistent with the API for shapes and paths. #15

Open timjs opened 6 years ago

timjs commented 6 years ago

I'm not very happy with the current api of the text module, also not very dissatisfied. It is indeed the case that with collages you're styling them "at once" and with text you style them "in parts". It is harder to get text right, because there are so many options. It is not clear to me yet which are the most common we could fit into helper functions. In Collage solid, dashed, dotted etc. fall into this category. They capture the most common styling options for lines: dashing, thickness and colour. More complicated styling can be done by creating a line style.

Let's strive to an API where giving multiple styling options twice is not allowed, as that is something I'm trying to avoid with collages. We need some more examples and feedback to decide on a good api for text.

(First brought up in #4.)

Kwarrtz commented 6 years ago

I know I'm the one who first proposed this change, but on consideration I think that if proposal #4 is implemented then the current API is actually preferable, because it allows you to easily combine multiple pieces text with different styling without having to resort to grouping and manually positioning different text pieces in a group.