Graphics.DrawString - not work fontfamily text format

393 views Asked by At

Overlay text on video:

using (f_graphics = Graphics.FromImage(f_bmp_overlay))
            {
                f_graphics.Clear(System.Drawing.Color.Transparent);
                f_graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
                f_graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                f_graphics.DrawString(f_text, f_font, f_color, new PointF(15, 15));
            }

Text color and size work good, but FontFamily apply only numbers.

enter image description here

What can be done?

1

There are 1 answers

0
Cee McSharpface On BEST ANSWER

You are using cyrillic characters, which the physical font obviously does not contain. So the system substitutes glyphs from another font it chooses. Try with latin characters and you will see that they too are properly printed.

You need a font file that contains glyphs for all Unicode code points you are printing, and use that instead.