-
Notifications
You must be signed in to change notification settings - Fork 1
/
FieldParameter.swift
38 lines (35 loc) · 918 Bytes
/
FieldParameter.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
//
// FieldParameter.swift
//
//
// Created by chen on 2023/11/11.
//
import Foundation
/// The ^FP command allows vertical and reverse formatting of the font field,
/// commonly used for printing Asian fonts.
///
/// # Field Parameter
public struct FieldParameter: ZPLCommandConvertible {
/// Direction
///
/// Default: `.horizontal`
public var direction: TextDirection
/// Additional inter- character gap (in dots)
///
/// Values: 0 to 9999
///
/// Default: 0 if no value is entered
public var gap: Int
public var command: String {
"^FP\(direction.rawValue),\(gap)"
}
/// Field Parameter.
///
/// - Parameters:
/// - direction: Direction.
/// - gap: Additional inter- character gap (in dots). 0 to 9999.
public init(direction: TextDirection, gap: Int) {
self.direction = direction
self.gap = gap
}
}