(self, xpos, ypos)
| 366 | self._group.appendChild(element) |
| 367 | |
| 368 | def _create_text(self, xpos, ypos): |
| 369 | # check option to override self.text with self.human (barcode as |
| 370 | # human readable data, can be used to print own formats) |
| 371 | barcodetext = self.human if self.human != "" else self.text |
| 372 | for subtext in barcodetext.split("\n"): |
| 373 | element = self._document.createElement("text") |
| 374 | attributes = { |
| 375 | "x": SIZE.format(xpos), |
| 376 | "y": SIZE.format(ypos), |
| 377 | "style": ( |
| 378 | f"fill:{self.foreground};" |
| 379 | f"font-size:{self.font_size}pt;text-anchor:middle;" |
| 380 | ), |
| 381 | } |
| 382 | _set_attributes(element, **attributes) |
| 383 | text_element = self._document.createTextNode(subtext) |
| 384 | element.appendChild(text_element) |
| 385 | self._group.appendChild(element) |
| 386 | ypos += pt2mm(self.font_size) + self.text_line_distance |
| 387 | |
| 388 | def _finish(self): |
| 389 | if self.compress: |
nothing calls this directly
no test coverage detected