示例#1
0
        public static void DrawText(Graphics graphics, string text, Font font, Point pt, Color foreColor, Color backColor)
        {
Retry:
            try
            {
                if (!Program.Config.EnableDirectWrite || fallback)
                {
                    TextRenderer.DrawText(graphics, text, font, pt, foreColor, backColor);
                }
                else
                {
                    DirectWriteTextRenderer.DrawText(graphics, text, font, pt, foreColor, backColor);
                }
            }
            catch (FileNotFoundException exception)
            {
                if (Fallback())
                {
                    goto Retry;
                }
                ShowError(exception);
                throw;
            }
        }
示例#2
0
        public static void DrawText(Graphics graphics, string text, Font font, Rectangle bounds, Color foreColor, TextFormatFlags flags)
        {
Retry:
            try
            {
                if (!Program.Config.EnableDirectWrite || fallback)
                {
                    TextRenderer.DrawText(graphics, text, font, bounds, foreColor, flags);
                }
                else
                {
                    DirectWriteTextRenderer.DrawText(graphics, text, font, bounds, foreColor, flags);
                }
            }
            catch (FileNotFoundException exception)
            {
                if (Fallback())
                {
                    goto Retry;
                }
                ShowError(exception);
                throw;
            }
        }