Enums

Enumerations for ESC/POS parameters used across the SDK.

These IntEnum types are intentionally thin wrappers around the raw values expected by the printer firmware, so they can be used directly as byte arguments to ESC/POS commands without explicit conversion.

class goojprt.enums.Align(*values)[source]

Bases: IntEnum

Horizontal text / object alignment.

Used as the n parameter of the ESC a n command.

CENTER = 1
LEFT = 0
RIGHT = 2
class goojprt.enums.CodePage(*values)[source]

Bases: IntEnum

ESC/POS character code table, selectable via ESC t n.

Most low-cost Chinese thermal printers ship with only a minimal subset of code pages. If guaranteed diacritic support is required, render the text as a bitmap (see rendering.text.render_text_image) instead of switching the firmware code page.

PC437 = 0
PC850 = 2
PC852 = 18
PC858 = 19
PC866 = 17
WPC1250 = 16
class goojprt.enums.TextSize(*values)[source]

Bases: IntEnum

Character size multiplier, encoded as a bit mask for GS ! n.

The high nibble encodes the horizontal multiplier and the low nibble encodes the vertical multiplier (0 = 1×, 1 = 2×, 2 = 3×, …).

DOUBLE_BOTH = 49
DOUBLE_HEIGHT = 17
DOUBLE_WIDTH = 32
NORMAL = 0