-
-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Labels
Description
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of Fonts
- I have verified if the problem exist in both
DEBUGandRELEASEmode - I have searched open and closed issues to ensure it has not already been reported
Fonts version
3.0.0-alpha.0.13
Other Six Labors packages and versions
4.0.0-alpha.0.57 / Drawing: 3.0.0-alpha.0.6
Environment (Operating system, version and so on)
Ubuntu 24.04
.NET Framework version
.net 9.0
Description
I'm getting this exception when using HintingMode with some specific fonts
Unhandled exception. System.ArgumentOutOfRangeException: Parameter "index" (System.Int32) must be between or equal to 0 and 25, was 39 (Parameter 'index')
at SixLabors.ThrowHelper.ThrowArgumentOutOfRangeException(String name, String message)
at SixLabors.ThrowHelper.ThrowArgumentOutOfRangeExceptionForMustBeBetweenOrEqualTo[T](T value, T minimum, T maximum, String name)
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.CheckIndex(Int32 index, Int32 length)
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.ReadCvt()
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.Execute(StackInstructionStream stream, Boolean inFunction, Boolean allowFunctionDefs)
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.Execute(StackInstructionStream stream, Boolean inFunction, Boolean allowFunctionDefs)
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.Execute(StackInstructionStream stream, Boolean inFunction, Boolean allowFunctionDefs)
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.Execute(StackInstructionStream stream, Boolean inFunction, Boolean allowFunctionDefs)
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.Execute(StackInstructionStream stream, Boolean inFunction, Boolean allowFunctionDefs)
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.Execute(StackInstructionStream stream, Boolean inFunction, Boolean allowFunctionDefs)
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.Execute(StackInstructionStream stream, Boolean inFunction, Boolean allowFunctionDefs)
at SixLabors.Fonts.Tables.TrueType.Hinting.TrueTypeInterpreter.HintGlyph(ControlPoint[] controlPoints, IReadOnlyList`1 endPoints, ReadOnlyMemory`1 instructions, Boolean isComposite)
at SixLabors.Fonts.Tables.TrueType.Glyphs.GlyphVector.Hint(HintingMode hintingMode, GlyphVector& glyph, TrueTypeInterpreter interpreter, Vector2 pp1, Vector2 pp2, Vector2 pp3, Vector2 pp4)
at SixLabors.Fonts.StreamFontMetrics.ApplyTrueTypeHinting(HintingMode hintingMode, GlyphMetrics metrics, GlyphVector& glyphVector, Vector2 scaleXY, Single pixelSize)
at SixLabors.Fonts.Tables.TrueType.TrueTypeGlyphMetrics.<>c__DisplayClass7_0.<RenderTo>b__0(Single _)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at SixLabors.Fonts.Tables.TrueType.TrueTypeGlyphMetrics.RenderTo(IGlyphRenderer renderer, Int32 graphemeIndex, Vector2 location, Vector2 offset, GlyphLayoutMode mode, TextOptions options)
at SixLabors.Fonts.Glyph.RenderTo(IGlyphRenderer surface, Int32 graphemeIndex, Vector2 location, Vector2 offset, GlyphLayoutMode mode, TextOptions options)
at SixLabors.Fonts.Rendering.TextRenderer.RenderText(ReadOnlySpan`1 text, TextOptions options)
at SixLabors.Fonts.Rendering.TextRenderer.RenderText(String text, TextOptions options)
at SixLabors.ImageSharp.Drawing.Processing.Processors.Text.DrawTextProcessor`1.BeforeImageApply()
at SixLabors.ImageSharp.Processing.Processors.ImageProcessor`1.SixLabors.ImageSharp.Processing.Processors.IImageProcessor<TPixel>.Execute()
at SixLabors.ImageSharp.Processing.DefaultImageProcessorContext`1.ApplyProcessor(IImageProcessor processor, Rectangle rectangle)
at SixLabors.ImageSharp.Processing.DefaultImageProcessorContext`1.ApplyProcessor(IImageProcessor processor)
at SixLabors.ImageSharp.Drawing.Processing.DrawTextExtensions.DrawText(IImageProcessingContext source, DrawingOptions drawingOptions, RichTextOptions textOptions, String text, Brush brush, Pen pen)
at SixLabors.ImageSharp.Drawing.Processing.DrawTextExtensions.DrawText(IImageProcessingContext source, RichTextOptions textOptions, String text, Brush brush, Pen pen)
at SixLabors.ImageSharp.Drawing.Processing.DrawTextExtensions.DrawText(IImageProcessingContext source, RichTextOptions textOptions, String text, Color color)
at ImageSharpFont.HintingModeCrash.<>c__DisplayClass0_0.<Render>b__1(IImageProcessingContext x) in /tmp/repro/HintingModeCrash.cs:line 35
at SixLabors.ImageSharp.Processing.ProcessingExtensions.Mutate[TPixel](Image`1 source, Configuration configuration, Action`1 operation)
at SixLabors.ImageSharp.Processing.ProcessingExtensions.Mutate[TPixel](Image`1 source, Action`1 operation)
at ImageSharpFont.HintingModeCrash.<Render>g__Draw|0_0(String title, FontFamily fontFamily, String text) in /tmp/repro/HintingModeCrash.cs:line 35
at ImageSharpFont.HintingModeCrash.Render() in /tmp/repro/HintingModeCrash.cs:line 17
at Program.<Main>$(String[] args) in /tmp/repro/Program.cs:line 3
Steps to Reproduce
See the repro: repro.zip
Basically enabling HintingMode when rendering with Noto Sans Ogham or Noto Sans Runic
Images
No response
jcoqueret-mediaclip