/// <summary> /// 双语标签 /// </summary> /// <param name="protocol">协议</param> /// <param name="startX">标签起始x坐标</param> /// <param name="startY">标签起始y坐标</param> /// <param name="zhCnLabel">中文标签</param> /// <param name="enLabel">英文标签</param> /// <param name="lineSpacing">行距</param> /// <param name="zhCnFontSize">中文字体大小</param> /// <param name="enFontSize">英文字体大小</param> public static CPCLPrintCommand BilingualLabel(this CPCLPrintCommand protocol, int startX, int startY, string zhCnLabel, string enLabel, int lineSpacing = 5, FontSize zhCnFontSize = FontSize.Size24, FontSize enFontSize = FontSize.Size16) { protocol.DrawText(startX, startY, zhCnLabel, zhCnFontSize); protocol.DrawText(startX, startY + (int)zhCnFontSize + lineSpacing, enLabel, enFontSize); return(protocol); }
/// <summary> /// 画标题内容项 /// </summary> /// <param name="command"></param> /// <param name="y"></param> /// <param name="yMargin"></param> /// <param name="leftX"></param> /// <param name="rightX"></param> /// <param name="left"></param> /// <param name="right"></param> /// <param name="fontSize"></param> /// <param name="rightBold"></param> private void DrawItem(CPCLPrintCommand command, ref int y, int yMargin, int leftX, int rightX, string left, string right, int fontSize, bool rightBold = false) { int x1 = leftX; int x2 = rightX; command.DrawText(x1, y, left, fontSize, 0, false, false, false); command.DrawText(x2, y, right, fontSize, 0, rightBold, false, false); y += yMargin + fontSize; }