Add support for printing on red/black tapes

My QL-800 refuses to print black only on a red/black tape.

I really don't like the added `rb` function parameter.
It would be best to be able to recognize such tapes, however
nothing of the sort is documented in official Brother documentation.

makeBitmapData{,RB} also look like they could be simplified further.
This commit is contained in:
2021-06-10 02:24:00 +02:00
parent 9734cdd16e
commit 269e6514df
5 changed files with 80 additions and 22 deletions

View File

@@ -211,7 +211,7 @@ func handle(w http.ResponseWriter, r *http.Request) {
font.Font, params.Text, mediaInfo.PrintAreaPins, params.Scale)
}
if r.FormValue("print") != "" {
if err := printer.Print(img); err != nil {
if err := printer.Print(img, false); err != nil {
log.Println("print error:", err)
}
}

View File

@@ -17,6 +17,7 @@ import (
var scale = flag.Int("scale", 1, "integer upscaling")
var rotate = flag.Bool("rotate", false, "print sideways")
var redblack = flag.Bool("redblack", false, "red and black print")
func main() {
flag.Usage = func() {
@@ -82,7 +83,7 @@ func main() {
log.Fatalln("the image is too high,", dy, ">", mi.PrintAreaLength, "pt")
}
if err := p.Print(img); err != nil {
if err := p.Print(img, *redblack); err != nil {
log.Fatalln(err)
}
}

View File

@@ -309,7 +309,7 @@ func printLabel(id string) error {
}
return printer.Print(&imgutil.LeftRotate{Image: label.GenLabelForHeight(
labelFont, id, mediaInfo.PrintAreaPins, db.BDFScale)})
labelFont, id, mediaInfo.PrintAreaPins, db.BDFScale)}, false)
}
func handleLabel(w http.ResponseWriter, r *http.Request) {