text_width() public method

public text_width ( Graphics g, string text, Font override_font = null ) : int
g System.Drawing.Graphics
text string
override_font System.Drawing.Font
return int
Exemplo n.º 1
0
        private void draw_sub_string(int left, string sub, Graphics g, Brush b, Rectangle r, StringFormat fmt, text_part print)
        {
            int   width    = drawer_.text_width(g, sub, drawer_.font(print));
            Color print_bg = drawer_.print_bg_color(ListItem, print);

            if (print_bg.ToArgb() != bg_color_.ToArgb())
            {
                Rectangle here = new Rectangle(r.Location, r.Size);
                here.X    += left;
                here.Width = width + 1;
                g.FillRectangle(brush_.brush(print_bg), here);
            }

            Rectangle sub_r = new Rectangle(r.Location, r.Size);

            sub_r.X     += left;
            sub_r.Width -= left;
            g.DrawString(sub, drawer_.font(print), brush_.brush(drawer_.print_fg_color(ListItem, print)), sub_r, fmt);
        }
Exemplo n.º 2
0
 private int text_width(Graphics g, string text)
 {
     return(drawer_.text_width(g, text));
 }