Skip to content

DrawText() results in "wobbly" drawn text? #336

Discussion options

You must be logged in to vote

2.1.4 is the latest version which contains your fix for the offset outline.

When no pen is set the output is fine.

FontCollection collection = new();
FontFamily family = collection.Add(@"C:\Users\james\Downloads\VictorMonoAll\TTF\VictorMono-Regular.ttf");
Font font = family.CreateFont(11.25f);

RichTextOptions options = new(font);

const string text = "The quick brown fox etc etc";

FontRectangle advance = TextMeasurer.MeasureAdvance(text, options);

using Image<Rgba32> image = new((int)Math.Ceiling(advance.Width), (int)Math.Ceiling(advance.Height), Color.Black);
image.Mutate(i => i.DrawText(options, text, Color.White));

image.SaveAsPng(@"C:\Users\james\Downloads\wobbly.png");

When set …

Replies: 2 comments 5 replies

Comment options

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

@QuantumToasted
Comment options

Comment options

You must be logged in to vote
3 replies
@JimBobSquarePants
Comment options

Answer selected by QuantumToasted
@QuantumToasted
Comment options

@JimBobSquarePants
Comment options

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