Is there a way to measure the height that is produced from a string with the specified font, pointsize, and font-weight with word wrapping enabled?
Right now, I get a width of 6000px and a height of 57px from a long paragraph of text because there is no word wrapping in the measurement. I'm guessing this functionality doesn't wrap since only a caption word wraps.
Here is my current code
Right now, I get a width of 6000px and a height of 57px from a long paragraph of text because there is no word wrapping in the measurement. I'm guessing this functionality doesn't wrap since only a caption word wraps.
Here is my current code
var image = new Bitmap(width, height);
var ms = new MemoryStream();
image.Save(ms, ImageFormat.Jpeg);
using (MagickImage g = new MagickImage(ms, new MagickReadSettings() { Font = fontForImageMagick, FontPointsize = font.Size, FontWeight = FontWeight.Thin, Width = width }))
{
// Get the metrics of the text the user has typed in
TypeMetric fontInfo = g.FontTypeMetrics(textToFit);
}