Too long text is silently discarded
With a template like
<img src="{{label_tools.qr_code(label_id)}}"/>
<span class='label'>{{ label_text }}</span>
css style like in README.rst and records like
records= [
...
dict(label_id="112", label_text="123456789012"),
dict(label_id="113", label_text="1234567890123"),
dict(label_id="114", label_text="12345678901234"),
dict(label_id="115", label_text="123456789012345"),
dict(label_id="116", label_text="1234567890123456"),
dict(label_id="117", label_text="12345678901234567"),
dict(label_id="118", label_text="123456789012345678"),
...
all labels after "12345678901234" only contains the QR code while the text is blank.
One thing is not handling auto-scaling or word splitting, but silently dropping input is really bad. Could you please fix to at least give a warning/error?
Can you provide a full example, with HTML, CSS and python? I suspect that the issue here is not "dropping input" but a formatting issue: when the label is too long, it gets printed on a new line that falls outside of the printed area of the label. This could be partially fixed by CSS, using either text-overflow: ellipsis; or word-break: always;.
I too am having this issue. I'm re writing a script with your library. I need to resize the text so it fits the label. No idea how to do it with css. Have tried multiple ways :/ .
You could decide the font size (or even the page size) based on the label length, on the python side, since the template uses Jinja.