Code

Mnemonics in "Fill and stroke", "Align and distribute", and "Transform" dialogs ...
[inkscape.git] / share / extensions / text_braille.py
1 #!/usr/bin/env python
2 #encoding: utf-8
3 import chardataeffect, inkex, string
5 convert_table = {\
6 'a': unicode("⠁", "utf-8"),\
7 'b': unicode("⠃", "utf-8"),\
8 'c': unicode("⠉", "utf-8"),\
9 'd': unicode("⠙", "utf-8"),\
10 'e': unicode("⠑", "utf-8"),\
11 'f': unicode("⠋", "utf-8"),\
12 'g': unicode("⠛", "utf-8"),\
13 'h': unicode("⠓", "utf-8"),\
14 'i': unicode("⠊", "utf-8"),\
15 'j': unicode("⠚", "utf-8"),\
16 'k': unicode("⠅", "utf-8"),\
17 'l': unicode("⠇", "utf-8"),\
18 'm': unicode("⠍", "utf-8"),\
19 'n': unicode("⠝", "utf-8"),\
20 'o': unicode("⠕", "utf-8"),\
21 'p': unicode("⠏", "utf-8"),\
22 'q': unicode("⠟", "utf-8"),\
23 'r': unicode("⠗", "utf-8"),\
24 's': unicode("⠎", "utf-8"),\
25 't': unicode("⠞", "utf-8"),\
26 'u': unicode("⠥", "utf-8"),\
27 'v': unicode("⠧", "utf-8"),\
28 'w': unicode("⠺", "utf-8"),\
29 'x': unicode("⠭", "utf-8"),\
30 'y': unicode("⠽", "utf-8"),\
31 'z': unicode("⠵", "utf-8"),\
32 }
34 class C(chardataeffect.CharDataEffect):
36   def process_chardata(self,text, line, par):
37     r = ""
38     for c in text:
39       if convert_table.has_key(c.lower()):
40         r = r + convert_table[c.lower()]
41       else:
42         r = r + c
43     return r
45 c = C()
46 c.affect()