日期:2014-05-18  浏览次数:20966 次

为什么打印之前要多余的去测量字体大小?
C# code

            Font titleFont = new Font("宋体", 12);
            SizeF titleSize = e.Graphics.MeasureString("计划单", titleFont);//测量字体大小
            X = (e.PageBounds.Width - titleSize.Width) / 2;
            e.Graphics.DrawString("计划单", titleFont, Brushes.Black, X, Y);//画标题
            Y += titleSize.Height + 15;
            X = e.PageBounds.Width * 0.05f;
            titleFont.Dispose();



测量字体大小那行貌似删了也没什么特别

------解决方案--------------------
字体的大小是会影响到排版打印的