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
This commit is contained in:
@@ -39,7 +39,8 @@ module Libptouch
|
||||
:left_margin_dots, :uint16,
|
||||
:right_margin_dots, :uint16,
|
||||
:min_feed_dots, :uint16,
|
||||
:min_feed_mm, :double
|
||||
:min_feed_mm, :double,
|
||||
:printer_family, :uint32
|
||||
end
|
||||
|
||||
class PngOptions < FFI::Struct
|
||||
@@ -51,6 +52,7 @@ module Libptouch
|
||||
end
|
||||
|
||||
attach_function :libptouch_create, [], :pointer
|
||||
attach_function :libptouch_printer_family_label, [:uint32], :string
|
||||
attach_function :libptouch_destroy, [:pointer], :void
|
||||
attach_function :libptouch_strerror, [:pointer], :string
|
||||
attach_function :libptouch_last_error, [:pointer], :int
|
||||
|
||||
@@ -151,6 +151,7 @@ module Libptouch
|
||||
def current_media_info
|
||||
info = Binding::MediaInfo.new
|
||||
raise_on_error(Binding.libptouch_get_current_media_info(@native, info.pointer))
|
||||
fam = info[:printer_family]
|
||||
{
|
||||
media_width_code: info[:media_width_code],
|
||||
media_kind_code: info[:media_kind_code],
|
||||
@@ -161,7 +162,9 @@ module Libptouch
|
||||
left_margin_dots: info[:left_margin_dots],
|
||||
right_margin_dots: info[:right_margin_dots],
|
||||
min_feed_dots: info[:min_feed_dots],
|
||||
min_feed_mm: info[:min_feed_mm]
|
||||
min_feed_mm: info[:min_feed_mm],
|
||||
printer_family: fam,
|
||||
printer_family_label: Binding.libptouch_printer_family_label(fam)
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user