TextMeasurer.Measure and IImageProcessingContext.DrawText fail if the first character is a /
See original GitHub issuePrerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of Fonts
- I have verified if the problem exist in both
DEBUG
andRELEASE
mode - I have searched open and closed issues to ensure it has not already been reported
Description
Measuring or drawing text that starts with a forward slash / fails with an ArgumentOutOfRangeException
This appears to be located in DefaultShaper.AssignFeatures
if (shapingData.CodePoint == FractionSlash || shapingData.CodePoint == Slash)
This will call
shapingData = collection.GetGlyphShapingData(start - 1);
when start == 0
Steps to Reproduce
var font = SystemFonts.CreateFont("Arial", 12);
var rendererOptions = new TextOptions(font)
{
WrappingLength = 100,
Origin = new PointF(0, 0)
};
var measurement = TextMeasurer.Measure("/ This will fail", rendererOptions);
System Configuration
Windows 10 and AWS Linux 2
- Fonts version: SixLabors.Fonts 1.0.0-beta16
- Other Six Labors packages and versions: SixLabors.ImageSharp 2.0.0, SixLabors.ImageSharp.Drawing 1.0.0-beta14
- Environment (Operating system, version and so on): Windows 10/AWS Linux 2
- .NET Framework version: .NET 6.0
- Additional information:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
'IImageProcessingContext' does not contain a definition for ...
I am running the latest version and I am getting the error as preceding. Severity Code Description Project File Line Suppression State Error...
Read more >C# (CSharp) TextMeasurer Examples
C# (CSharp) TextMeasurer - 32 examples found. These are the top rated real world C# (CSharp) examples of TextMeasurer extracted from open source...
Read more >Imagesharp draw image on image. Drawing we have been ...
However, the method does not seem to work as intended as more often than not it throws one of two exceptions, or simply...
Read more >Show Recent Blog Posts In GitHub ReadMe Using An ...
In this article, you will learn how to show recent blog posts in GitHub ReadMe using an Azure Function.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I wasn’t planning on a NuGet release until the RC but since it’s a fairly critical bug I’ll get something pushed out in the next few days.
@JimBobSquarePants Thanks for the nuget release.