/// <summary> /// 加粗。将文字加粗 /// </summary> /// <param name="state">打印模式状态</param> public byte[] Bold(PrinterModeState state) => state == PrinterModeState.On ? new byte[] { 27, 'E'.ToByte(), 1 } : new byte[] { 27, 'E'.ToByte(), 0 };
/// <summary> /// 倾斜。将文字变为斜体 /// </summary> /// <param name="state">打印模式状态</param> public byte[] Italic(PrinterModeState state) => state == PrinterModeState.On ? new byte[] { 27, '4'.ToByte() } : new byte[] { 27, '5'.ToByte() };
/// <summary> /// 下划线。为文字添加下划线 /// </summary> /// <param name="state">打印模式状态</param> public byte[] Underline(PrinterModeState state) => state == PrinterModeState.On ? new byte[] { 27, '-'.ToByte(), 1 } : new byte[] { 27, '-'.ToByte(), 0 };
/// <summary> /// 稀疏 /// </summary> /// <param name="state">打印模式状态</param> public byte[] Expanded(PrinterModeState state) => state == PrinterModeState.On ? new byte[] { 29, '!'.ToByte(), 16 } : new byte[] { 29, '!'.ToByte(), 0 };
public byte[] Expanded(PrinterModeState state) { return(new byte[] { 27, 'W'.ToByte(), state == PrinterModeState.On ? '1'.ToByte() : '0'.ToByte() }); }
public void BoldMode(PrinterModeState state) { Write(_command.FontMode.Bold(state)); }
public void UnderlineMode(PrinterModeState state) { Write(_command.FontMode.Underline(state)); }
public void BoldMode(PrinterModeState state) { Append(_command.FontMode.Bold(state)); }
public void ItalicMode(PrinterModeState state) { Write(_command.FontMode.Italic(state)); }
public byte[] Bold(PrinterModeState state) { return(state == PrinterModeState.On ? new byte[] { 27, 'E'.ToByte(), 1 } : new byte[] { 27, 'E'.ToByte(), 0 }); }
public byte[] Condensed(PrinterModeState state) { return(state == PrinterModeState.On ? new byte[] { 27, '!'.ToByte(), 1 } : new byte[] { 27, '!'.ToByte(), 0 }); }
public byte[] Expanded(PrinterModeState state) { return(state == PrinterModeState.On ? new byte[] { 27, 'w'.ToByte(), 1 } : new byte[] { 27, 'w'.ToByte(), 0 }); }
public byte[] Italic(PrinterModeState state) { return(state == PrinterModeState.On ? new byte[] { 27, '4'.ToByte() } : new byte[] { 27, '5'.ToByte() }); }
public void ExpandedMode(PrinterModeState state) { Write(_command.FontMode.Expanded(state)); }
/// <summary> /// 倾斜。将文字变为斜体 /// </summary> /// <param name="state">打印模式状态</param> public virtual TPrinter Italic(PrinterModeState state) => Write(Command.FontMode.Italic(state));
/// <summary> /// 加粗。将文字加粗 /// </summary> /// <param name="state">打印模式状态</param> public virtual TPrinter Bold(PrinterModeState state) => Write(Command.FontMode.Bold(state));
/// <summary> /// 下划线。为文字添加下划线 /// </summary> /// <param name="state">打印模式状态</param> public virtual TPrinter Underline(PrinterModeState state) => Write(Command.FontMode.Underline(state));
/// <summary> /// 稀疏 /// </summary> /// <param name="state">打印模式状态</param> public virtual TPrinter Expanded(PrinterModeState state) => Write(Command.FontMode.Expanded(state));
/// <summary> /// 简明 /// </summary> /// <param name="state">打印模式</param> public byte[] Condensed(PrinterModeState state) => state == PrinterModeState.On ? Command.ASCII.CompressionSize : Command.ASCII.NormalSize.AddBytes(Command.Chinese.FontSizeReset);
/// <summary> /// 简明 /// </summary> /// <param name="state">打印模式</param> public virtual TPrinter Condensed(PrinterModeState state) => Write(Command.FontMode.Condensed(state));
public void CondensedMode(PrinterModeState state) { Write(_command.FontMode.Condensed(state)); }
public byte[] Condensed(PrinterModeState state) { return(state == PrinterModeState.On ? new byte[] { 27, 15 } : new byte[] { 27, 18, 20 }); }