I'm trying to use node-red-contrib-image-tools to create a label to be output to a Dymo LabelWriter 450.
After some head scratching a couple of days ago I managed to get my pi 3B talking to the Dymo printer over USB.
This morning I've been playing some more and have a label template with company logo on it (png file) to which I add text to, that's all working good.
Next I need to add a Code39 barcode . . . so I downloaded a TTF code39 font and added it. This is where I'm struggling . . . are TTF fonts supported ? the notes say . .
"(Required) font to print. NOTE: This can be one of the presets or the path to a fnt file"
. . . is " . . . fnt file" a typo or does it literally mean an old Windows type font format ? I tried passing the path to my font, not 100% sure I did that right (I'm a Windows person not Linux ) and I did that by storing it in a flow variable (flow.font) and then using that in the font|str property (see below)
The path to my font file was: /usr/share/fonts/truetype/code39/fre3of9x.ttf
I try not to ask for help until I've made a good effort at resolving issues myself . . . I've managed to get most of the way, just need to sort adding the barcode.
Unfortunately the underlying library doesn't support TrueType fonts. Only bitmap based fnt fonts.
To add barcodes you need a node that generates an image and then you composite it or blit it onto your image.
I have (in a local version of image tools) already creating barcodes (including code 39) that plays nicely with imagetools but it's not ready to publish I'm afraid.
So when creating the Bitmap font I was making it bigger gradually to fit my available label space, but it didn't seem to be getting bigger on the label. I found the cause, it seems to be a caching type issue. If I overwrite the font with the same name and path it doesn't update on the label.
I've just created a few different size options with the size as a suffix to the font name, now when I change the font name it updates correctly on my label.
So I have code39-80.fnt, code39-90.fnt, etc. I'm sure you get the idea.
Very nice, I'm almost finished the hardware debugging part of my project so will be moving on to the Node Red side more during the next few weeks. I'll let you know how I get on and if I have any issues or other feedback.