Azgaar / Armoria

Heraldry generator and editor
https://azgaar.github.io/Armoria
273 stars 30 forks source link

Implement text elements on shield #106

Closed Blipz closed 1 year ago

Blipz commented 1 year ago

Clicking on the text will display draggable elements for easier edition of the underlying SVG path (limited to straight lines and quadratic Bezier curves). Dragging while holding the Shift key moves the path as a whole.

Azgaar commented 1 year ago

Great idea, I have considered the same, but in a bit different form. Here is what I think can be improved:

  1. UX: it's really hard to move the text. I know about Shift from your comment, but users won't know. Also even with Shift it's hard to use. I believe the element should be dragged the same as charges - with simple drag (no shift), in grid, with text inputs. The path change mode can be toggled on click or via the menu
  2. There should be some text by default. Like 'Inscription' or 'Armoria', the later is better as it doesn't require translation
  3. We can preinstall an interesting font and do a default Inscription using it
  4. There should be a simple way to add more fonts or at least a predefined list of fonts (like I did for Map Generator)
  5. The default one should be bigger and more prominent
Blipz commented 1 year ago

Thanks for the feedback, I will work on improving that.

Blipz commented 1 year ago

This should be better now.

Azgaar commented 1 year ago

I will try to review it compeltely tomorrow, too tied today, but I have launched it and it looks super good.

Azgaar commented 1 year ago

Will have to add font to the svg itself for download (here it was Cinzel). Also can add a shade, it's really easy and looks good (here I've used 2 inscriptions).

armoria_2023-08-07-01-12-53

Azgaar commented 1 year ago

Need to rework fonts editor, it's really hard to use

Blipz commented 1 year ago

Will have to add font to the svg itself for download (here it was Cinzel).

I think this should be fixed already, do you have the 0c950ab commit?

Also can add a shade, it's really easy and looks good (here I've used 2 inscriptions).

I don't know, this seems to add quite a number of additional parameters (color, dx, dy, maybe blur?) if we want do to it for each inscription. Or maybe the user could select a predefined SVG filter from a list, and filters could be configured elsewhere (and potentially be used for charges or ordinaries)?

Need to rework fonts editor, it's really hard to use

Not sure why, what would you prefer?

Azgaar commented 1 year ago

I don't know, this seems to add quite a number of additional parameters (color, dx, dy, maybe blur?) if we want do to it for each inscription. Or maybe the user could select a predefined SVG filter from a list, and filters could be configured elsewhere (and potentially be used for charges or ordinaries)?

We have do shared with text-shadow css, it's pretty easy. It really helps to make the text readable.

Not sure why, what would you prefer?

Hard to say, it's just not clear what to do there. There should be a simplex UI. Also there is no need to remove loaded fonts, so we can remove this feature.

Azgaar commented 1 year ago

What about putting Inscription outside of the shield group? It will allow to put text above or below the shield. Looks good: armoria_2023-08-10-18-43-00

Blipz commented 1 year ago

What about putting Inscription outside of the shield group? It will allow to put text above or below the shield.

In my opinion, this should be done globally, independently of this change, to also allow charges outside of the shield, like that:

Blipz commented 1 year ago

For inscriptions outside the shield, a charge like this one would be useful, too:

Azgaar commented 1 year ago

For inscriptions outside the shield, a charge like this one would be useful, too:

Yes, definitely. I added ribbons before, but have no access to this old local branch :(

Azgaar commented 1 year ago

It makes sense, but there is a problem with charges. Sometimes charges are too big and generated partially out of the shield, sometimes it's even expected. In this cases we want charges to be clipped by the shield shape

Blipz commented 1 year ago

Yes, for consistency reasons shouldn't there be an option for each charge and inscription controlling whether to put it outside of the shield or not? (even if I don't know if there is a use case for clipping text, but why not)

Also: in this change I assumed inscriptions will always be upon charges and ordinaries, I hope this limitation is acceptable.

Azgaar commented 1 year ago

We don't need it for text, but for charges - it would be nice to have, but it will make the renderer more complex. We also have API and Map Generator, we need to update their renderers as well. Maybe they don't need text, but charges should be fully rendered. Potentially I thing about create a single rendered as an API that would serve for all tools. The current API is not that good as it has issues (as there is no svg engine in node.js)

Azgaar commented 1 year ago

The limitation is fine

Azgaar commented 1 year ago

Nice update, still need to find time to revire it all and merge.

Azgaar commented 1 year ago

Closing this and will merge #137 (commits will be saved in history)