From fa696f46758525e2049896328cc08e464a873158 Mon Sep 17 00:00:00 2001 From: Florian Ostertag Date: Wed, 20 Nov 2024 17:59:13 +0100 Subject: [PATCH] fix: adjust rendering box for large characters (#730) --- Vocaluxe/Base/Fonts/CGlyph.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Base/Fonts/CGlyph.cs b/Vocaluxe/Base/Fonts/CGlyph.cs index f9bc02ed..acfa367e 100644 --- a/Vocaluxe/Base/Fonts/CGlyph.cs +++ b/Vocaluxe/Base/Fonts/CGlyph.cs @@ -53,7 +53,7 @@ namespace Vocaluxe.Base.Fonts //Gets exact height and width for drawing more than 1 char. But width is to small to draw char on bitmap as e.g. italic chars will get cropped //See https://stackoverflow.com/questions/11708621/how-to-measure-width-of-a-string-precisely StringFormat format = StringFormat.GenericTypographic; - RectangleF rect = new RectangleF(0, 0, 1000, 1000); + RectangleF rect = new RectangleF(0, 0, 2000, 2000); CharacterRange[] ranges = { new CharacterRange(0, chrString.Length) }; format.SetMeasurableCharacterRanges(ranges); _BoundingBox = g.MeasureCharacterRanges(chrString, fo, rect, format)[0].GetBounds(g).Size; @@ -233,4 +233,4 @@ namespace Vocaluxe.Base.Fonts return new Rectangle(minX, minY, maxX - minX, bmp.Height - minY); } } -} \ No newline at end of file +}