StringFormat stringFormat = new StringFormat();
stringFormat.Alignment = StringAlignment.Center;
//stringFormat.Alignment = StringAlignment.Far; //右对齐
//Rectangle rect = new Rectangle(0, 0, Width, Height);
float fontsize = keyEntry.getFontInfo().getSize().getFloatValue();
float x = this.Width / 2f ;
float y = this.Height / 2f - (fontsize / 2f);
grphic.DrawString("b", new Font("宋体", fontsize, GraphicsUnit.Pixel), new SolidBrush(AppUtil.parseColor(textColor)), x, y, stringFormat);
x坐标为什么不需要减去字体,是因为是从中心开始绘制的。