Renderizar texto suavizado usando TextRenderer C #

Sep 21 2020

Eu escrevi um programa para desenhar alguns fios em uma imagem. Eu uso graphics.DrawString()mas como você pode ver neste post, tem alguns problemas.
TextRenderer.DrawText()resolveu esse problema, mas o texto renderizado está irregular. Eu mudei tanto a graphics.TextRenderingHintresolução dos gráficos; TextRenderernão liga para nada.
Deve haver uma solução como é feito aqui ; mas não sei como fazer.

Respostas

IanBoyd Sep 23 2020 at 18:53
        private void panel1_Paint(object sender, PaintEventArgs e)
        {
            //GDI (i.e. TextRenderer)
            String s = "The quick brown fox jumped over the lazy dog";
            Point origin = new Point(11, 11);
            Font font = SystemFonts.IconTitleFont;

            e.Graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixel;

            TextRenderer.DrawText(e.Graphics, s, font, origin, SystemColors.InfoText);
        }

Mostrando demonstração completa que faz o trabalho:https://mega.nz/file/E3xREYIR#kuDxyac_0jxlX7wuTVmZmJgClEicdaCj0YpnE83Wq9k