-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChangeAlphanumericDefaultFont.swift
46 lines (43 loc) · 1.35 KB
/
ChangeAlphanumericDefaultFont.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// ChangeAlphanumericDefaultFont.swift
//
//
// Created by chen on 2023/11/12.
//
import Foundation
/// The ^CF command sets the default font used in your printer. You can use the ^CF command to simplify your programs.
///
/// # Change Alphanumeric Default Font
public struct ChangeAlphanumericDefaultFont: ZPLCommandConvertible {
/// Specified default font
///
/// Values: A through Z and 0 to 9
///
/// Initial Value at Power Up: A
public var font: Character
/// Individual character width (in dots)
///
/// Values: 0 to 32000
/// Initial Value at Power Up: 9
public var height: Int?
/// individual character width (in dots)
///
/// Values: 0 to 32000
///
/// Initial Value at Power Up: 5 or last permanent saved value
public var width: Int?
public var command: String {
"^CF\(font),\(height?.description ?? ""),\(width?.description ?? "")"
}
/// Change Alphanumeric Default Font.
///
/// - Parameters:
/// - font: Specified default font. A through Z and 0 to 9.
/// - height: Individual character width (in dots). 0 to 32000.
/// - width: individual character width (in dots). 0 to 32000.
public init(font: Character, height: Int? = nil, width: Int? = nil) {
self.font = font
self.width = width
self.height = height
}
}