def output_char(char): H = char[2] V = char[3] color = char[5] text = name_lookup[font.get_char_name(char[0], char[1])] node = new('text') if color: node.setAttribute('fill', color) node.setAttribute('x', c2s(H)) node.setAttribute('y', c2s(V)) node.appendChild(self.document.createTextNode(text)) return node
def output_char_string(list): H = list[0][2] V = list[0][3] color = list[0][5] text = ''.join([name_lookup[font.get_char_name(item[0], item[1])] for item in list]) node = new('text') if color: node.setAttribute('fill', color) node.setAttribute('x', c2s(H)) node.setAttribute('y', c2s(V)) node.appendChild(self.document.createTextNode(text)) return node
def output_char_string(list): H = list[0][2] V = list[0][3] color = list[0][5] text = ''.join([ name_lookup[font.get_char_name(item[0], item[1])] for item in list ]) node = new('text') if color: node.setAttribute('fill', color) node.setAttribute('x', c2s(H)) node.setAttribute('y', c2s(V)) node.appendChild(self.document.createTextNode(text)) return node
def isglyphknown(fntnum, dvicode): try: return bool(name_lookup[font.get_char_name(fntnum, dvicode)]) except KeyError: return False
def isglyphknown(fntnum, dvicode): try: return bool(name_lookup[font.get_char_name( fntnum, dvicode)]) except KeyError: return False