Files
ptouch_label/ruby/lib/libptouch.rb
knb bfd6adda42 libptouch: P700/P900 families, optional JSON config, ESC i z and print sequencing
- Add printer_family and profile flags; load overrides from printer_families.json
- Set ESC i z page byte from profile; pass prof into ptouch_fill_esc_iz
- End print with 0x1A only (drop FF prefix); extend Ruby FFI and CLI media info
- Add reference/ptp_raster_ref.adoc; install config under share/ptouch_label

Made-with: Cursor
2026-04-19 12:20:21 +09:00

36 lines
739 B
Ruby
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# frozen_string_literal: true
# Ruby FFI bindings for libptouch (Brother P-touch raster printing).
#
# Author: knb
# Email: knb@artif.org
require_relative "libptouch/version"
require_relative "libptouch/error"
require_relative "libptouch/binding"
require_relative "libptouch/status_hash"
require_relative "libptouch/context"
module Libptouch
ERR_NOMEM = 1
ERR_ARG = 2
ERR_USB = 3
ERR_IO = 4
ERR_UNSUPPORTED = 5
ERR_NOT_FOUND = 6
ERR_IMAGE = 7
USB_VID_BROTHER = 0x04f9
USB_PID_PTP900W = 0x2085
USB_PID_PTP750W = 0x2062
USB_PID_PTP710BT = 0x20af
STATUS_LENGTH = 32
PNG_DEFAULT_THRESHOLD = 128
# libptouch_printer_family_tC API と同じ値)
FAMILY_UNKNOWN = 0
FAMILY_P700 = 1
FAMILY_P900 = 2
end