libgdiplus icon indicating copy to clipboard operation
libgdiplus copied to clipboard

A long string without spaces and line breaks is drawn without word wrap in Linux

Open andrey-astakhov opened this issue 5 years ago • 2 comments

Below is the code-snippet illustrating the issue. In Windows the code works fine.

RectangleF textRect = new RectangleF(new PointF(0, 0), new SizeF(115, 44));
Rectangle borderRect = new Rectangle(new Point(0, 0), new Size(116, 45));
string textToDraw = "WordWrapWordWrapWordWrapWordWrapWordWrapWordWrapWordWrapWordWrapWordWrap";
Image img = new Bitmap(117, 46);
Graphics gr = Graphics.FromImage(img);
Font font = new Font("Arial", 9.75f);
Brush brush = Brushes.Black;
gr.DrawRectangle(new Pen(brush), borderRect);
gr.DrawString(textToDraw, font, brush, textRect);
img.Save("drawing.png", ImageFormat.Png);

Thanks, Andy.

andrey-astakhov avatar Jan 21 '20 07:01 andrey-astakhov

Is there any movement on this? We have the same problem with controls on CentOS!

oleg-varlamov avatar Jul 13 '20 05:07 oleg-varlamov

The same issue, using v6.0.5 on Debian Also, the rest of the text after this long word is not displayed at all ... For example, for "WordWrapWordWrapWordWrapWordWrapWordWrapWordWrapWrapWordWrap 1 2 3 4 5", only left part of first word will be visible,

IshmaZX82 avatar Jul 30 '20 13:07 IshmaZX82