Lines Matching refs:text
28 TEXT_TEMPLATE = 'font-size:%dpx;text-align:center;text-anchor:middle;'
38 def error(self, text, msg):
41 "Error encoding '%s' as %s barcode: %s\n" % (text, self.name, msg))
44 def encode(self, text):
59 self.text = param.get('text', None)
67 if not self.text:
89 string = self.encode(self.text)
136 # Add text at the bottom of the barcode
137 text = etree.SubElement(barcode, '{%s}text' % SVG_URI)
138 text.set('x', str(int(bar_width / 2)))
139 text.set('y', str(min(tops) + self.font_size - 1))
141 text.set('y', str(self.height + max(tops) + self.font_size))
142 text.set('style', TEXT_TEMPLATE % self.font_size)
143 text.set('{http://www.w3.org/XML/1998/namespace}space', 'preserve')
144 text.set('id', '%s_text' % name)
145 text.text = str(self.text)