SixLabors / ImageSharp.Drawing

:pen: Extensions to ImageSharp containing a cross-platform 2D polygon manipulation API and drawing operations.
https://sixlabors.com/products/imagesharp-drawing/
Other
282 stars 38 forks source link

Allow passing Matrix3x2 to DrawTextProcessor #125

Closed antonfirsov closed 3 years ago

antonfirsov commented 3 years ago

Follow-up on the discussion #124.

We should enable using an arbitrary Matrix3x2 transform as a parameter within DrawTextProcessor.

The easiest implementation seems to be to pass it to PathBuilder here: https://github.com/SixLabors/ImageSharp.Drawing/blob/e09fe9b91877cf0ae61480dee087476d0208d29d/src/ImageSharp.Drawing/Processing/Processors/Text/DrawTextProcessor%7BTPixel%7D.cs#L223

Open questions

Before implementing, we need to figure out how does the transform interfere with DrawTextProcessor.Location and ultimately RenderOptions.Origin. Ideally, I would replace DrawTextProcessor.Location with DrawTextProcessor.Transform entirely, but there might be things I'm missing.

@tocsoft any thoughts?