add cut bitmask option and debug dump support
Replace auto-cut toggle with --cut bit flags (default 011), wire flags through C/Ruby APIs, and document the new cut/debug-dump behavior in both READMEs. Made-with: Cursor
This commit is contained in:
@@ -39,6 +39,8 @@ SVG は現在装着テープの印字可能幅に合わせて自動拡大・縮
|
||||
また、`--template`(SVG)と `--data`(JSON/YAML)を使うと `data-field` 属性をキーにした差込印刷が可能です。
|
||||
`data-kb-placeholder="qr"` / `data-kb-placeholder="barcode"` を付けた SVG 要素(`x/y/width/height` 必須)には、対応する `data-field` 値から QR / Code128 バーコードを生成して差し込みできます。
|
||||
`--trim-right[=DOTS]` を付けると、libptouch 側の共通処理でラベル右側の空白ドット列を削減します。`DOTS` 省略時は左余白ドット数を使い、取得失敗時は `0` にフォールバックします。
|
||||
`--cut BITS` は 3bit(`[auto-cut][half-cut][chain-print]`)で、例 `010` のように指定します。既定は `011` です。
|
||||
`--debug-dump PATH` を付けると USB へ送る印字データをファイル保存します(1 印刷ごとに上書き)。
|
||||
|
||||
開発ツリーからそのまま試す例:
|
||||
|
||||
@@ -48,6 +50,8 @@ bundle exec ruby -I lib exe/ptouch-label -n -f ../samples/your.png
|
||||
bundle exec ruby -I lib exe/ptouch-label -n -f ../samples/your.svg
|
||||
bundle exec ruby -I lib exe/ptouch-label -n -f ../samples/your.svg --trim-right
|
||||
bundle exec ruby -I lib exe/ptouch-label -n -f ../samples/your.svg --trim-right=20
|
||||
bundle exec ruby -I lib exe/ptouch-label -n -f ../samples/your.png --cut 010
|
||||
bundle exec ruby -I lib exe/ptouch-label -f ../samples/your.png --debug-dump print_job.bin
|
||||
bundle exec ruby -I lib exe/ptouch-label -n --template ../samples/your_template.svg --data ../samples/your_data.yml
|
||||
bundle exec ruby -I lib exe/ptouch-label --media-info
|
||||
bundle exec ruby -I lib exe/ptouch-label --status -p 0x2062
|
||||
@@ -98,7 +102,7 @@ ctx.dispose
|
||||
|
||||
## API の範囲
|
||||
|
||||
- 実行ファイル `ptouch-label`(互換: `ptouch-print-png`)… PNG/SVG(`-f`, `-t`, `-p`, `-n`, `-M`, `-S`, `-V`, `-h`, `--template`, `--data`, `--trim-right[=DOTS]`)。`-M` は現在テープ情報(幅 mm・DPI 等)を JSON 出力、`-S` はステータス JSON 出力、`--trim-right` は右側空白列を削減
|
||||
- 実行ファイル `ptouch-label`(互換: `ptouch-print-png`)… PNG/SVG(`-f`, `-t`, `-p`, `-n`, `-M`, `-S`, `-V`, `-h`, `--template`, `--data`, `--trim-right[=DOTS]`, `--cut BITS`, `--debug-dump PATH`)。`-M` は現在テープ情報(幅 mm・DPI 等)を JSON 出力、`-S` はステータス JSON 出力、`--trim-right` は右側空白列を削減
|
||||
- `Libptouch::Context` … `open_usb` / `open_usb_vid_pid` / `close` / `dispose`
|
||||
- `check_raster` / `print_raster` / `png_file_to_raster` / `svg_file_to_raster_fit_current_tape` / `status_bytes` / `status_hash` / `current_media_info`
|
||||
- `current_media_info` には `print_dpi` / `feed_dpi` / `tape_width_mm` / `printable_height_dots` / `min_feed_mm` などを含む(テープ幅方向は `printable_height_dots`)
|
||||
|
||||
Reference in New Issue
Block a user