question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextMeasurer.Measure and IImageProcessingContext.DrawText fail if the first character is a /

See original GitHub issue

Prerequisites

  • 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 and RELEASE 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
JimBobSquarePantscommented, May 6, 2022

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.

1reaction
woutwarecommented, May 18, 2022

@JimBobSquarePants Thanks for the nuget release.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found