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

Issues with TextOptions and Fonts.RendererOptions #174

Closed antonfirsov closed 2 years ago

antonfirsov commented 2 years ago

It's unfortunate that we have two very similar types with duplicate functionalities across our libraries. It's also doesn't align with good API design practices that some properties are settable, while others are get-only and initialized from the constructor.

We should clean up the API for ImageSharp.Drawing. If possible we should declare both types in SixLabors.Fonts and make them compose each other. If not we should make their relationship clear from the naming and define conversion API-s on the types.

Fonts.RendererOptions TextOptions
Font
TabWidth TabWidth
ApplyKerning ApplyKerning
DpiX DpiX
DpiY DpiY
FallbackFontFamilies FallbackFonts
WrappingWidth WrapTextWidth
WordBreaking WordBreaking
LineSpacing LineSpacing
TextDirection
TextAlignment
HorizontalAlignment HorizontalAlignment
VerticalAlignment VerticalAlignment
LayoutMode
Origin
ColorFontSupport RenderColorFonts