Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Index was outside the bounds of the array." #22

Closed
dotnetnoobie opened this issue Apr 13, 2017 · 3 comments
Closed

"Index was outside the bounds of the array." #22

dotnetnoobie opened this issue Apr 13, 2017 · 3 comments

Comments

@dotnetnoobie
Copy link

Error Using ImageSharp.Drawing, but the error is related to the font.

Not really sure if I should post the issue here or on ImageSharp, but as it seems to be font related I posted it here

I have the latest packages of
ImageSharp - 1.0.0-alpha5-00069
ImageSharp.Drawing - 1.0.0-alpha5-00063
SixLabors.Fonts - 0.1.0-alpha0006

Again using a font from Google Fonts, this is the font that caused the error
https://fonts.google.com/specimen/Love+Ya+Like+A+Sister

The error occurs in this method from previous answer for Text Wrapping issue thread
https://github.com/SixLabors/Demos/blob/master/WaterMarkSample/Program.cs#L71

at ImageSharp.Processing.ImageProcessor1.Apply(ImageBase1 source, Rectangle sourceRectangle)
at ImageSharp.Image1.ApplyProcessor(IImageProcessor1 processor, Rectangle rectangle)
at ImageSharp.ImageExtensions.DrawText[TColor](Image1 source, String text, Font font, IBrush1 brush, IPen1 pen, Vector2 location, TextGraphicsOptions options) at ImageSharp.ImageExtensions.DrawText[TColor](Image1 source, String text, Font font, TColor color, Vector2 location, TextGraphicsOptions options)

This is the Inner Exception

at SixLabors.Shapes.InternalPath.FindIntersections(Vector2 start, Vector2 end, Vector2[] buffer, Int32 count, Int32 offset)
at SixLabors.Shapes.ComplexPolygon.FindIntersections(Vector2 start, Vector2 end, Vector2[] buffer, Int32 count, Int32 offset)
at ImageSharp.Drawing.ShapeRegion.Scan(Single y, Single[] buffer, Int32 length, Int32 offset)
at ImageSharp.Drawing.Processors.FillRegionProcessor1.OnApply(ImageBase1 source, Rectangle sourceRectangle)
at ImageSharp.Processing.ImageProcessor1.Apply(ImageBase1 source, Rectangle sourceRectangle)

@tocsoft
Copy link
Member

tocsoft commented Apr 13, 2017

Interesting one this one, turns out its not a bug in either ImageSharp or SixLabors.Fonts but is actually in SixLabors.Shapes.

the root cause if due to the font having lots of fine detailing and some of those details end up being reduced down to nothing.

Closing this one and i'll track it on the SixLabors.Shapes repo. I should have a fix out for it soon.

@tocsoft tocsoft closed this as completed Apr 13, 2017
@dotnetnoobie
Copy link
Author

Yes I have just been trying a bunch of different fonts

This seems to only happen with fonts that have characters/glyphs which are not 1 "solid" "shape"
any fonts that have character that has a complicated shapes made up of many bits this error seems to occur

@tocsoft
Copy link
Member

tocsoft commented Apr 13, 2017

This should be fixed in SixLabors.Shapes version 0.1.0-alpha0011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants