[x] I have verified that I am running the latest version of Fonts
[ ] I have verified if the problem exist in both DEBUG and RELEASE mode
[x] I have searched open and closed issues to ensure it has not already been reported
Description
Using the most recent version (1.0.0) of the SixLabors.Fonts from NuGet.org with the current available version of SixLabors.ImageSharp.Drawing (1.0.0-beta15) fails to mutate the image and draw simple text (numbers only) with system font. It throws exception like this
Exception has occurred: CLR/System.TypeLoadException
An unhandled exception of type 'System.TypeLoadException' occurred in SixLabors.ImageSharp.dll: 'Method 'BeginGlyph' in type 'CachingGlyphRenderer' from assembly 'SixLabors.ImageSharp.Drawing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13' does not have an implementation.'
at SixLabors.ImageSharp.Drawing.Processing.Processors.Text.DrawTextProcessor`1.BeforeImageApply()
at SixLabors.ImageSharp.Processing.Processors.ImageProcessor`1.SixLabors.ImageSharp.Processing.Processors.IImageProcessor<TPixel>.Execute()
at SixLabors.ImageSharp.Processing.DefaultImageProcessorContext`1.ApplyProcessor(IImageProcessor processor, Rectangle rectangle)
at SixLabors.ImageSharp.Processing.DefaultImageProcessorContext`1.ApplyProcessor(IImageProcessor processor)
at SixLabors.ImageSharp.Drawing.Processing.DrawTextExtensions.DrawText(IImageProcessingContext source, String text, Font font, Color color, PointF location)
Steps to Reproduce
Create new .Net project.
Add required packages (currently it installs SixLabors.Fonts 1.0.0 and SixLabors.ImageSharp.Drawing 1.0.0-beta15)
FontCollection fonts = new();
fonts.AddSystemFonts();
if(!fonts.TryGet("Calibri", out FontFamily fontFamily))
{
throw new Exception("Font not found.");
}
Font f = fontFamily.CreateFont(12);
using Image image = Image.Load(fileName); //tested with .png image
image.Mutate(i => i.DrawText("1", f, Color.Grey, new PointF(10, 10))); //Exception raised here
image.SaveAsPng(fileName);
Run the application.
System Configuration
Windows 10 22H2 x64.
.Net 6.0.300.
Additional information
Previous version of SixLabors.Fonts (1.0.0-beta19) works fine and above code does what it is supposed to do.
Prerequisites
DEBUG
andRELEASE
modeDescription
Using the most recent version (1.0.0) of the SixLabors.Fonts from NuGet.org with the current available version of SixLabors.ImageSharp.Drawing (1.0.0-beta15) fails to mutate the image and draw simple text (numbers only) with system font. It throws exception like this
Steps to Reproduce
System Configuration
Windows 10 22H2 x64. .Net 6.0.300.
Additional information
Previous version of SixLabors.Fonts (1.0.0-beta19) works fine and above code does what it is supposed to do.