Exemplo n.º 1
0
        /// <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 };
Exemplo n.º 2
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() };
Exemplo n.º 3
0
        /// <summary>
        /// 下划线。为文字添加下划线
        /// </summary>
        /// <param name="state">打印模式状态</param>
        public byte[] Underline(PrinterModeState state) => state == PrinterModeState.On
            ? new byte[]
        {
            27, '-'.ToByte(), 1
        }

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