question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hinting makes text looks like zalgo.

See original GitHub issue

Description

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

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jakerdycommented, Aug 3, 2022

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.

0reactions
JimBobSquarePantscommented, Oct 15, 2022

Fixed with #295

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zalgo Text Generator - Create Glitchy Text Online
Zalgo Text Generator is a free tool to convert your text into glitch text. However, the Zalgo text is a glitchy form of...
Read more >
How does Zalgo text work?
Zalgo text works because of combining characters. These are special characters that allow to modify character that comes before. enter image ...
Read more >
Zalgo Text Generator
This is the zalgo text generator. It allows you to convert normal text into zalgo text which you can then copy and paste....
Read more >
Zalgo Text Generator ➜ #1 😍 Z͉̾á̘͉̉l͈̯̾̀g̥̤͌̈ó͎̥͡ ...
Zalgo Text Generator is the most popular online free tool to generate unlimited Glitch Fonts & Weird Text from normal text for Instagram...
Read more >
Zalgo text causes Netty to throw an exception · Issue #2474
If I paste some zalgo text into a form input and submit the form, Netty throws an exception and the page is completely...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found