Prerequisites
Fonts version
2.1.3
Other Six Labors packages and versions
ImageSharp 3.1.12, Drawing 2.1.7
Environment (Operating system, version and so on)
Win11
.NET Framework version
.Net 8
Description
There is a problem with wordwrap after a colon: the word is broken into parts, although it should not.
If the same text doesn't contain a colon, the word isn't broken into parts.
Steps to Reproduce
var sixFont = SystemFonts.CreateFont("Times New Roman", 25f);
var textOptions = new RichTextOptions(sixFont)
{
WrappingLength = 300,
WordBreaking = WordBreaking.BreakWord
};
var text1 = "số khung: RRKWCH1UM7XJ00693";
var text2 = "số khung RRKWCH1UM7XJ00693";
using var image = new Image<SixLabors.ImageSharp.PixelFormats.Rgba32>(400, 100);
image.Mutate(ctx =>
{
ctx.Fill(Color.White);
ctx.DrawLine(Color.Red, 2f, new PointF[] { new PointF(300, 0), new PointF(300, 100) });
ctx.DrawText(textOptions, text1, SixLabors.ImageSharp.Color.Black);
textOptions.Origin = new PointF(0, 50);
ctx.DrawText(textOptions, text2, SixLabors.ImageSharp.Color.Black);
});
image.SaveAsPng(@"test.png");
This code outputs two lines of text.
Red line is a WrappingLength marker.
The second line has no colon, and the entire word is wrapped:
Images

Prerequisites
DEBUGandRELEASEmodeFonts version
2.1.3
Other Six Labors packages and versions
ImageSharp 3.1.12, Drawing 2.1.7
Environment (Operating system, version and so on)
Win11
.NET Framework version
.Net 8
Description
There is a problem with wordwrap after a colon: the word is broken into parts, although it should not.
If the same text doesn't contain a colon, the word isn't broken into parts.
Steps to Reproduce
This code outputs two lines of text.
Red line is a WrappingLength marker.
The second line has no colon, and the entire word is wrapped:
Images