Open ThomasGoulet73 opened 3 years ago
Feel free to change the implementation to use https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritetextanalyzer-getglyphs
SharpDX isn't covering everything we need and many parts don't work with Spans etc. so we need to allocate extra memory. I prefer HarfBuzzSharp over additional API's that are exposed via SharpDX.
@Gillibald I understand that one might be better than the other. But if one supports everything Avalonia.Direct2D1 needs (Which I think SharpDX.Direct2D1 does), I think we should take it. The reason I wanted to only have SharpDX.Direct2D1 is because it's already used in a lot of place in Avalonia.Direct2D1 while HarfBuzzSharp is used in 2 files.
The moment there is a modern maintained Direct2D1 binding I am willing to remove the HarfBuzz dependency from the Direct2D1 backend.
Is your feature request related to a problem? Please describe. I think the title is pretty self-explanatory. I think it would be good if Avalonia.Direct2D1 didn't depend on HarfBuzzSharp. SharpDX.Direct2D1 already has a text renderer (DirectWrite), which led me to think that HarfBuzzSharp was not used a lot and it turns out that there are only two file that uses it: TextShaperImpl.cs GlyphTypefaceImpl.cs
Describe the solution you'd like Replace the uses of HarfBuzzSharp with their DirectWrite counterpart (If said counterpart exists).
Additional context One of the benefit would be to remove the last native dependency for a Win32 and Direct2D1 application. libHarfBuzzSharp.dll is the last native file in a self-contained single-file .Net 6 app (You can remove it using by setting IncludeNativeLibrariesForSelfExtract to true but I don't think it's the right solution).