Skip to content

WrapTextWidth not wrapping/breaking long words #180

Answered by JimBobSquarePants
msipessr asked this question in Q&A
Discussion options

You must be logged in to vote

You'll need to use the latest MyGet build for this. 1.0.0-beta13.15

There's been some significant changes to the API while we get things ready for RC1.

using var image = new Image<Rgb24>(404, 147, Color.White);
TextOptions options = new(SystemFonts.CreateFont("arial", 16))
{
    WrappingLength = image.Width * .5F,
    WordBreaking = WordBreaking.BreakAll,
    Origin = new Vector2(20, 20),
};

image.Mutate(x => x.DrawText(options, "Text that will wrap inside the box just fine followed by Areallylongwordthatwontfitinmysetwidth", Color.Black));
image.SaveAsPng("word-break.png");

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@msipessr
Comment options

@JimBobSquarePants
Comment options

Answer selected by msipessr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants