home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Inkscape / Inkscape-0.48.2-1-win32.exe / share / extensions / text_braille.py < prev    next >
Text File  |  2011-07-08  |  1KB  |  46 lines

  1. #encoding: utf-8
  2. import chardataeffect, inkex, string
  3.  
  4. convert_table = {\
  5. 'a': unicode("Γáü", "utf-8"),\
  6. 'b': unicode("Γáâ", "utf-8"),\
  7. 'c': unicode("Γáë", "utf-8"),\
  8. 'd': unicode("ΓáÖ", "utf-8"),\
  9. 'e': unicode("Γáæ", "utf-8"),\
  10. 'f': unicode("Γáï", "utf-8"),\
  11. 'g': unicode("Γá¢", "utf-8"),\
  12. 'h': unicode("Γáô", "utf-8"),\
  13. 'i': unicode("Γáè", "utf-8"),\
  14. 'j': unicode("ΓáÜ", "utf-8"),\
  15. 'k': unicode("Γáà", "utf-8"),\
  16. 'l': unicode("Γáç", "utf-8"),\
  17. 'm': unicode("Γáì", "utf-8"),\
  18. 'n': unicode("Γá¥", "utf-8"),\
  19. 'o': unicode("Γáò", "utf-8"),\
  20. 'p': unicode("ΓáÅ", "utf-8"),\
  21. 'q': unicode("Γáƒ", "utf-8"),\
  22. 'r': unicode("Γáù", "utf-8"),\
  23. 's': unicode("ΓáÄ", "utf-8"),\
  24. 't': unicode("Γá₧", "utf-8"),\
  25. 'u': unicode("ΓáÑ", "utf-8"),\
  26. 'v': unicode("Γáº", "utf-8"),\
  27. 'w': unicode("Γá║", "utf-8"),\
  28. 'x': unicode("Γá¡", "utf-8"),\
  29. 'y': unicode("Γá╜", "utf-8"),\
  30. 'z': unicode("Γá╡", "utf-8"),\
  31. }
  32.  
  33. class C(chardataeffect.CharDataEffect):
  34.  
  35.   def process_chardata(self,text, line, par):
  36.     r = ""
  37.     for c in text:
  38.       if convert_table.has_key(c.lower()):
  39.         r = r + convert_table[c.lower()]
  40.       else:
  41.         r = r + c
  42.     return r
  43.  
  44. c = C()
  45. c.affect()
  46.