Hinting makes text looks like zalgo.
Description
I'm evaluating your library for my project. But when i tried to turn hinting on - text got broken:
Without hinting it's looks like this:

Steps to Reproduce
public static void Main(string[] args)
{
var fonts = new FontCollection();
FontFamily font = fonts.Add(@"Fonts\OpenSans-Regular.ttf");
using var img = new Image<Rgba32>(1024, 800);
img.Mutate(x => x.Fill(Color.White));
var str = "The quick brown fox jumps over the lazy dog. 0123456789";
var off_y = 0f;
for (int size = 5; size < 64; size++)
{
RenderText(font.CreateFont(size), str, img, off_y += size + 1);
}
using FileStream fs = File.Create("_six" + ".png");
img.SaveAsPng(fs);
}
public static void RenderText(Font font, string text, Image<Rgba32> img, float y)
{
string path = IOPath.GetInvalidFileNameChars().Aggregate(text, (x, c) => x.Replace($"{c}", "-"));
string fullPath = IOPath.GetFullPath(IOPath.Combine("Output", IOPath.Combine(path)));
IPathCollection shapes = TextBuilder.GenerateGlyphs(text, new TextOptions(font)
{
Origin = new Vector2(50f, y),
});
img.Mutate(x => x.Fill(Color.Black, shapes));
}
System Configuration
- Fonts version: 1.0.0-beta18
- Other Six Labors packages and versions: SixLabors.ImageSharp.Drawing 1.0.0-beta14.8
- Environment (Operating system, version and so on): Win10
- .NET Framework version: netcore sdk 3.1.421
See #293
Also, please don’t change the template
Nice test code btw. I’m going to use that while I finish fixing the issue
@eX-pes can you please attach your version of the font?
It was this one: https://github.com/SixLabors/Fonts/blob/v1.0.0-beta18/tests/SixLabors.Fonts.Tests/Fonts/OpenSans-Regular.ttf
We did checkout repo at 1.0.0-beta18 tag, and made our own example.
It looks like the fixes I'm working locally are working well.
Hinting is left, no hinting right
Fixed with #295