A set of .NET Framework managed libraries for developing graphical user interfaces.
Hi @mc ,
Thanks for reaching out.
Graphics.DrawString() is already drawing filled text with the brush you pass in, so this behavior comes from how the font is being rasterized rather than from it switching to an outline mode. With fonts like Microsoft YaHei, smaller sizes can look thin or slightly hollow depending on anti-aliasing, hinting, and the background color.
One thing worth trying is changing the text rendering hint, since that has a big effect on how solid the glyphs appear:
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
g.DrawString(text, new Font("Microsoft YaHei", fontSize), brush, new PointF(0, 0));
You can also compare it with ClearTypeGridFit or SingleBitPerPixelGridFit to see which result looks best in your case. If this is for normal WinForms-style UI text, TextRenderer.DrawText() is another good option because it uses the text rendering path that WinForms controls rely on, and it may give you a result that looks more natural on screen.
If the appearance still feels too “stroked,” the most suitable fixes are to use a slightly larger font size, try a different font, or render at a higher resolution and scale down. So the main point is that the text is being filled correctly already, but the rendering settings and font choice can make it look less solid than expected.
Hope this helps! If my explanation and the information I provided were also helpful to you, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.