Mercurial > MadButterfly
comparison tools/svg2code.py @ 285:248a40d51473
Check in test program for sh_text_set_text for debugging. It is not working yet.
author | wycc |
---|---|
date | Sat, 31 Jan 2009 16:52:28 +0800 |
parents | c8b6ca46950b |
children | 5c066380a84e |
comparison
equal
deleted
inserted
replaced
284:046a02a93fd9 | 285:248a40d51473 |
---|---|
132 prop_map = get_style_map(style_str) | 132 prop_map = get_style_map(style_str) |
133 | 133 |
134 try: | 134 try: |
135 opacity = float(node.getAttribute('opacity')) | 135 opacity = float(node.getAttribute('opacity')) |
136 except: | 136 except: |
137 opacity = 1.0 | 137 opacity = 0.5 |
138 pass | 138 pass |
139 | 139 |
140 if prop_map.has_key('fill'): | 140 if prop_map.has_key('fill'): |
141 fill = prop_map['fill'].strip() | 141 fill = prop_map['fill'].strip() |
142 if fill.startswith('#') and len(fill) == 7: | 142 if fill.startswith('#') and len(fill) == 7: |
566 print >> codefo, \ | 566 print >> codefo, \ |
567 'PANGO_END_TEXT([%s], [%s], %f, %f, 16, [%s])dnl' % ( | 567 'PANGO_END_TEXT([%s], [%s], %f, %f, 16, [%s])dnl' % ( |
568 text_id.encode('utf8'), u''.join(txt_strs).encode('utf8'), | 568 text_id.encode('utf8'), u''.join(txt_strs).encode('utf8'), |
569 x, y, coord_id.encode('utf8')) | 569 x, y, coord_id.encode('utf8')) |
570 translate_style(text, coord_id, codefo, doc, 'TEXT_') | 570 translate_style(text, coord_id, codefo, doc, 'TEXT_') |
571 if text.hasAttribute('mbname'): | |
572 ## \note mbname declare that this node should be in the | |
573 # symbol table. | |
574 mbname = text.getAttribute('mbname') | |
575 print >> codefo, 'ADD_SYMBOL([%s])dnl' % (mbname) | |
571 pass | 576 pass |
572 pass | 577 pass |
573 | 578 |
574 reo_func = re.compile('([a-zA-Z]+)\\([^\\)]*\\)') | 579 reo_func = re.compile('([a-zA-Z]+)\\([^\\)]*\\)') |
575 reo_translate = re.compile('translate\\(([-+]?[0-9]+(\\.[0-9]+)?),([-+]?[0-9]+(\\.[0-9]+)?)\\)') | 580 reo_translate = re.compile('translate\\(([-+]?[0-9]+(\\.[0-9]+)?),([-+]?[0-9]+(\\.[0-9]+)?)\\)') |