# -*- coding: iso-8859-7 -*-
##############################################################################
# ThanCad 0.0.9 "DoesSomething": 2dimensional CAD with raster support for engineers.
#
# Copyright (c) 2001-2009 Thanasis Stamos, August 23, 2009
# URL: http://thancad.sourceforge.net
# e-mail: cyberthanasis@excite.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details (www.gnu.org/licenses/gpl.html).
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
"""\
ThanCad 0.0.9 "DoesSomething": 2dimensional CAD with raster support for engineers.
This module defines ThanCad fonts made by straight lines.
"""
from types import *
from thanfont import ThanFont,ThanFontLine,thanFonts
def makePrime1Lines():
"""Makes the lines that define each character of fixed width line font Prime1.
Prime1 is a font which defines a letter as a set of straight line segments.
Each letter fits into a 6x9 units rectangle with left lower xy coordinates
0,-2 and right upper 6,7 (xy). All the letters are less than 6 units wide (x)
and most letters less than 5 units wide, thus leaving some space between the
letters of the same word.
All capital letters and most of the small letters are within the 0 to 7 y-range.
Small letters like p,q,y use the full y-range: -2 to 7
"""
dilines = \
{ 1 : [ [ 2,2,2,4,0,4,0,0,4,0,4,4,2,4,2,2 ] # "Not printable"
],
2 : [ [ 2,2,2,4,1,4,0,3,0,1,1,0,3,0,4,1,4,3,3,4,2,4,2,2 ] # "Not printable"
],
3 : [ [ 2,2,2,4,0,1,4,1,2,4,2,2 ] # "Not printable"
],
4 : [ [ 2,2,4,2,0,2,2,2,2,0,2,4,2,2 ] # "Not printable"
],
5 : [ [ 2,2,4,4,0,0,2,2,0,4,4,0,2,2 ] # "Not printable"
],
6 : [ [ 2,2,2,4,0,2,2,0,4,2,2,4,2,2 ] # "Not printable"
],
7 : [ [ 2,2,2,0,2,4,0,2,4,2,2,4,2,2 ] # "Not printable"
],
8 : [ [ 2,2,0,0,4,4,0,4,4,0,2,2 ] # "Not printable"
],
9 : [ [ 2,2,4,4,0,4,4,4,0,0,4,0,0,0,2,2 ] # "Not printable"
],
10 : [ [ 2,2,0,4,2,2,4,4,2,2,2,0,2,2 ] # "Not printable"
],
11 : [ [ 2,2,4,4,3,3,1,3,0,4,1,3,1,1,0,0,1,1,3,1,4,0,3,1,3,3,2,2 ] # "Not printable"
],
12 : [ [ 2,2,4,2,0,2,2,2,2,0,2,4,2,2,4,4,0,0,2,2,0,4,4,0,2,2 ] # "Not printable"
],
13 : [ [ 2,2,4,4,0,4,4,0,0,0,2,2 ] # "Not printable"
],
14 : [ [ 2,2,2,0,2,4,2,2 ] # "Not printable"
],
15 : [ [ 1,0,3,6,5,0,0,4,6,4,1,0 ] # "Not printable"
],
16 : [ [ 2,2,6,2,2,2 ] # "Not printable"
],
17 : [ # "Not printable"
],
18 : [ [ 0,3,4,3 ],
[ 4,5,0,5 ],
[ 0,1,4,1 ] # "Not printable"
],
19 : [ [ 0,3,6,3,4,4,4,2,6,3 ] # "Not printable"
],
20 : [ # "Not printable"
],
21 : [ [ 4,4,0,4 ],
[ 0,2,4,2 ],
[ 3,5,1,1 ] # "Not printable"
],
22 : [ [ 0,1,4,1 ],
[ 2,2,2,6,2,4,0,4,4,4 ] # "Not printable"
],
23 : [ [ 0,0,6,0 ] # "Not printable"
],
24 : [ # "Not printable"
],
25 : [ [ 0,7,6,7 ] # "Not printable"
],
26 : [ [ 0,1,1,0,2,0,3,1,3,6,4,7,5,7,6,6 ] # "Not printable"
],
27 : [ [ 1,2,4,2,5,3,5,4,4,5,1,5 ] # "Not printable"
],
28 : [ [ 1,4,3,0,5,4 ] # "Not printable"
],
29 : [ [ 0,1,1,2,2,2,4,0,5,0,6,1 ],
[ 0,3,1,4,2,4,4,2,5,2,6,3 ] # "Not printable"
],
30 : [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
],
202 : [ [ 0,7,0,0 ],
[ 4,0,2,5,0,3,4,7 ] # ""
],
203 : [ [ 0,0,2,7,4,0 ] # ""
],
204 : [ [ 4,0,4,7,2,3,0,7,0,0 ] # ""
],
205 : [ [ 4,7,4,0,0,7,0,0 ] # ""
],
206 : [ [ 0,7,4,7 ],
[ 1,4,3,4 ],
[ 0,0,4,0 ] # ""
],
207 : [ [ 4,6,3,7,1,7,0,6,0,1,1,0,3,0,4,1,4,6 ] # ""
],
208 : [ [ 0,0,0,7,4,7,4,0 ] # ""
],
209 : [ [ 0,0,0,7,3,7,4,6,4,5,3,4,0,4 ] # ""
],
210 : 63, # Not defined
211 : [ [ 5,0,1,0,3,4,1,7,5,7 ] # ""
],
212 : [ [ 4,7,0,7,2,7,2,0 ] # ""
],
213 : 89, # ""
214 : [ [ 1,1,0,2,0,5,1,6,3,6,4,5,4,2,3,1,1,1 ],
[ 2,7,2,0 ] # ""
],
215 : [ [ 4,7,0,0 ],
[ 4,0,0,7 ] # ""
],
216 : [ [ 0,7,0,3,1,2,3,2,4,3,4,7 ],
[ 2,7,2,0 ] # ""
],
217 : [ [ 0,0,1,0,1,1,0,2,0,6,1,7,3,7,4,6,4,2,3,1,3,0,4,0 ] # ""
],
#----------Not defined
218 : 201, # ""
219 : 89, # ""
220 : [ [ 5,0, 4,0, 4,1, 3,0, 1,0, 0,1, 0,3, 1,4, 3,4, 4,3, 4,4 ],
[ 4,3, 4,1 ],
[ 2,6, 2,5 ] # ""
],
221 : [ [ 4,3, 3,4, 1,4, 0,3, 1,2, 3,2 ],
[ 1,2, 0,1, 1,0, 3,0, 4,1 ],
[ 2,6, 2,5 ] # ""
],
222 : [ [ 0,4, 1,3, 1,0 ],
[ 1,3, 2,4, 3,4, 4,3, 4,-1 ],
[ 2,6, 2,5 ] # ""
],
223 : [ [ 1,4, 1,1, 2,0, 3,1 ],
[ 1,6, 1,5 ] # ""
],
224 : [ [ 0,4, 0,1, 1,0, 3,0, 4,1, 4,4 ],
[ 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4, 4,4 ],
[ 1,4, 1,0 ],
[ 3,4, 3,0 ] # ""
],
241 : [ [ 0,1, 1,0, 3,0, 4,1, 4,3, 3,4, 1,4, 0,3, 0,-2 ] # ""
],
242 : [ [ 3,4, 1,4, 0,3, 0,2, 1,1, 3,1, 4,0, 3,-1, 2,-1, 1,-1 ] # ""
],
243 : [ [ 5,4, 1,4, 0,3, 0,1, 1,0, 2,0, 3,1, 3,3, 2,4 ] # ""
],
244 : [ [ 0,4, 4,4 ],
[ 2,4, 2,1, 3,0, 4,1 ], # ""
],
245 : [ [ 0,4, 0,1, 1,0, 3,0, 4,1, 4,4 ] # ""
],
246 : [ [ 1,4, 0,3, 0,1, 1,0, 3,0, 4,1, 4,3, 3,4, 2,3, 2,-2 ] # ""
],
247 : [ [ 0,4, 4,-2 ],
[ 4,4, 0,-2 ] # ""
],
248 : [ [ 0,4, 0,1, 1,0, 3,0, 4,1, 4,4 ],
[ 2,4, 2,-2 ] # ""
],
249 : [ [ 1,4, 0,3, 0,1, 1,0, 2,1, 2,3 ],
[ 2,1, 3,0, 4,1, 4,3, 3,4 ] # ""
],
250 : [ [ 1,4, 1,1, 2,0, 3,1 ],
[ 0,5, 0,4 ],
[ 2,5, 2,4 ] # ""
],
251 : [ [ 0,4, 0,1, 1,0, 3,0, 4,1, 4,4 ],
[ 1,5, 1,4 ],
[ 3,5, 3,4 ] # ""
],
252 : [ [ 1,0, 3,0, 4,1, 4,3, 3,4, 1,4, 0,3, 0,1, 1,0 ],
[ 2,6, 2,5 ] # ""
],
253 : [ [ 0,4, 0,1, 1,0, 3,0, 4,1, 4,4 ],
[ 2,6, 2,5 ] # ""
],
254 : [ [ 1,4, 0,3, 0,1, 1,0, 2,1, 2,3 ],
[ 2,1, 3,0, 4,1, 4,3, 3,4 ],
[ 2,6, 2,5 ] # ""
],
255 : [ [ 0,0, 4,0, 4,4, 0,4, 0,0 ] # quadrilateral
]
}
for lines in dilines.itervalues():
if type(lines) == IntType: continue # An integer for indirection
lines.append([(7, 0)]) # The next character start position
return dilines
#=============================================================================
def makePrime2Lines():
"""Makes the lines that define each character of fixed width line font Prime2.
Prime2 is a font which defines a letter as a set of straight line segments.
Each letter fits into a 6x9 units rectangle with left lower xy coordinates
0,-2 and right upper 6,7 (xy). All the letters are less than 6 units wide (x)
and most letters less than 5 units wide, thus leaving some space between the
letters of the same word.
All capital letters and most of the small letters are within the 0 to 7 y-range.
Small letters like p,q,y use the full y-range: -2 to 7
This font is in construction. When it is finished, it will consist of polygons
which may be filled.
"""
"Makes the lines that define each character in thanFontPrime1."
dilines = \
{ 1 : [ [ 2,2,2,4,0,4,0,0,4,0,4,4,2,4,2,2 ] # "Not printable"
],
2 : [ [ 2,2,2,4,1,4,0,3,0,1,1,0,3,0,4,1,4,3,3,4,2,4,2,2 ] # "Not printable"
],
3 : [ [ 2,2,2,4,0,1,4,1,2,4,2,2 ] # "Not printable"
],
4 : [ [ 2,2,4,2,0,2,2,2,2,0,2,4,2,2 ] # "Not printable"
],
5 : [ [ 2,2,4,4,0,0,2,2,0,4,4,0,2,2 ] # "Not printable"
],
6 : [ [ 2,2,2,4,0,2,2,0,4,2,2,4,2,2 ] # "Not printable"
],
7 : [ [ 2,2,2,0,2,4,0,2,4,2,2,4,2,2 ] # "Not printable"
],
8 : [ [ 2,2,0,0,4,4,0,4,4,0,2,2 ] # "Not printable"
],
9 : [ [ 2,2,4,4,0,4,4,4,0,0,4,0,0,0,2,2 ] # "Not printable"
],
10 : [ [ 2,2,0,4,2,2,4,4,2,2,2,0,2,2 ] # "Not printable"
],
11 : [ [ 2,2,4,4,3,3,1,3,0,4,1,3,1,1,0,0,1,1,3,1,4,0,3,1,3,3,2,2 ] # "Not printable"
],
12 : [ [ 2,2,4,2,0,2,2,2,2,0,2,4,2,2,4,4,0,0,2,2,0,4,4,0,2,2 ] # "Not printable"
],
13 : [ [ 2,2,4,4,0,4,4,0,0,0,2,2 ] # "Not printable"
],
14 : [ [ 2,2,2,0,2,4,2,2 ] # "Not printable"
],
15 : [ [ 1,0,3,6,5,0,0,4,6,4,1,0 ] # "Not printable"
],
16 : [ [ 2,2,6,2,2,2 ] # "Not printable"
],
17 : [ # "Not printable"
],
18 : [ [ 0,3,4,3 ],
[ 4,5,0,5 ],
[ 0,1,4,1 ] # "Not printable"
],
19 : [ [ 0,3,6,3,4,4,4,2,6,3 ] # "Not printable"
],
20 : [ # "Not printable"
],
21 : [ [ 4,4,0,4 ],
[ 0,2,4,2 ],
[ 3,5,1,1 ] # "Not printable"
],
22 : [ [ 0,1,4,1 ],
[ 2,2,2,6,2,4,0,4,4,4 ] # "Not printable"
],
23 : [ [ 0,0,6,0 ] # "Not printable"
],
24 : [ # "Not printable"
],
25 : [ [ 0,7,6,7 ] # "Not printable"
],
26 : [ [ 0,1,1,0,2,0,3,1,3,6,4,7,5,7,6,6 ] # "Not printable"
],
27 : [ [ 1,2,4,2,5,3,5,4,4,5,1,5 ] # "Not printable"
],
28 : [ [ 1,4,3,0,5,4 ] # "Not printable"
],
29 : [ [ 0,1,1,2,2,2,4,0,5,0,6,1 ],
[ 0,3,1,4,2,4,4,2,5,2,6,3 ] # "Not printable"
],
30 : [ [ 3,0,3,6 ],
[ 5,4,4,5,2,5,1,4,1,2,2,1,4,1,5,2 ] # "Not printable"
],
31 : [ [ 0,3,4,3,4,2 ] # "Not printable"
],
32 : [ # " "
],
33 : [ [ 1,0,2,1,3,0,1,0 ],
[ 2,2,2,7 ] # "!"
],
34 : [ [ 2,5,2,7,1,7,2,5 ],
[ 4,5,4,7,3,7,4,5 ] # """
],
35 : [ [ 0,1,4,1 ],
[ 4,3,0,3 ],
[ 1,4,1,0 ],
[ 3,0,3,4 ] # "#"
],
36 : [ [ 2,7,2,0 ],
[ 0,2,3,2,4,3,3,4,1,4,0,5,1,6,4,6 ] # "$"
],
37 : [ [ 4,1,4,0,3,0,3,1,4,1 ],
[ 0,0,4,7 ],
[ 1,7,1,6,0,6,0,7,1,7 ] # "%"
],
38 : [ [ 4,1,3,0,1,0,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1,5,2,5,2,4 ],
[ 2,1,1,1,1,2,2,2,2,1,1,0 ] # ";"
],
60 : [ [ 4,2,0,4,4,6 ] # "<"
],
61 : [ [ 4,4,0,4 ],
[ 0,2,4,2 ] # "="
],
62 : [ [ 0,2,4,4,0,6 ] # ">"
],
63 : [ [ 1,0,2,1,3,0,1,0 ],
[ 2,2,2,4,3,4,4,5,4,6,3,7,1,7,0,6 ] # "?"
],
64 : [ [ 3,1,1,1,0,2,0,5,1,6,3,6,4,5,4,2,3,3,3,4,2,5,1,4,1,3,2,2,3,3 ] # "@"
],
65 : [ [ 3.500, 2.750,
0.500, 2.750,
0.500, 0.000,
0.000, 0.000,
0.000, 6.000,
1.000, 7.000,
3.000, 7.000,
4.000, 6.000,
4.000, 0.000,
3.500, 0.000,
3.500, 2.750
],
[ 3.500, 3.250,
3.500, 5.793,
2.793, 6.500,
1.207, 6.500,
0.500, 5.793,
0.500, 3.250,
3.500, 3.250
]
],
66 : [ [4,1, 3,0, 0,0, 0,7, 3,7, 4,6, 4,5, 3,4, 4,3, 4,1],
[ 2.543, 3.750,
3.500, 2.793,
3.500, 1.207,
2.793, 0.500,
0.500, 0.500,
0.500, 3.750,
2.543, 3.750 # "A"
],
[ 0.500, 4.250,
0.500, 6.500,
2.793, 6.500,
3.500, 5.793,
3.500, 5.207,
2.543, 4.250,
0.500, 4.250 # "B"
]
],
67 : [ [ 4,6,3,7,1,7,0,6,0,1,1,0,3,0,4,1, # "C"
3.646, 1.354,
2.793, 0.500,
1.207, 0.500,
0.500, 1.207,
0.500, 5.793,
1.207, 6.500,
2.793, 6.500,
3.646, 5.646,
4, 6
]
],
68 : [ [3,7, 4,6, 4,1, 3,0, 0,0, 0,7, 3,7], # "D"
[2.793, 6.500,
3.500, 5.793,
3.500, 1.207,
2.793, 0.500,
0.500, 0.500,
0.500, 6.500,
2.793, 6.500
],
],
69 : [ [ 4,0,0,0,0,7,4,7,0,7,0,4,3,4 ] # "E"
],
70 : [ [ 0,0,0,7,4,7,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""
],
242 : [ [ 3,4, 1,4, 0,3, 0,2, 1,1, 3,1, 4,0, 3,-1, 2,-1, 1,-1 ] # ""
],
243 : [ [ 5,4, 1,4, 0,3, 0,1, 1,0, 2,0, 3,1, 3,3, 2,4 ] # ""
],
244 : [ [ 0,4, 4,4 ],
[ 2,4, 2,1, 3,0, 4,1 ], # ""
],
245 : [ [ 0,4, 0,1, 1,0, 3,0, 4,1, 4,4 ] # ""
],
246 : [ [ 1,4, 0,3, 0,1, 1,0, 3,0, 4,1, 4,3, 3,4, 2,3, 2,-2 ] # ""
],
247 : [ [ 0,4, 4,-2 ],
[ 4,4, 0,-2 ] # ""
],
248 : [ [ 0,4, 0,1, 1,0, 3,0, 4,1, 4,4 ],
[ 2,4, 2,-2 ] # ""
],
249 : [ [ 1,4, 0,3, 0,1, 1,0, 2,1, 2,3 ],
[ 2,1, 3,0, 4,1, 4,3, 3,4 ] # ""
],
250 : [ [ 1,4, 1,1, 2,0, 3,1 ],
[ 0,5, 0,4 ],
[ 2,5, 2,4 ] # ""
],
251 : [ [ 0,4, 0,1, 1,0, 3,0, 4,1, 4,4 ],
[ 1,5, 1,4 ],
[ 3,5, 3,4 ] # ""
],
252 : [ [ 1,0, 3,0, 4,1, 4,3, 3,4, 1,4, 0,3, 0,1, 1,0 ],
[ 2,6, 2,5 ] # ""
],
253 : [ [ 0,4, 0,1, 1,0, 3,0, 4,1, 4,4 ],
[ 2,6, 2,5 ] # ""
],
254 : [ [ 1,4, 0,3, 0,1, 1,0, 2,1, 2,3 ],
[ 2,1, 3,0, 4,1, 4,3, 3,4 ],
[ 2,6, 2,5 ] # ""
],
255 : [ [ 0,0, 4,0, 4,4, 0,4, 0,0 ] # quadrilateral
]
}
for lines in dilines.itervalues():
if type(lines) == IntType: continue
lines.append([(7, 0)])
return dilines
def makeLcd1Lines():
"""Makes the lines that define each character of fixed width line font Lcd1.
Lcd1 is a font which defines a letter as a set of straight line segments.
Each letter fits into a 6x9 units rectangle with left lower xy coordinates
0,-2 and right upper 6,7 (xy). All the letters are less than 6 units wide (x)
and most letters less than 5 units wide, thus leaving some space between the
letters of the same word.
All capital letters and most of the small letters are within the 0 to 7 y-range.
Small letters like p,q,y use the full y-range: -2 to 7
"""
dilines = \
{32 : [ # " "
],
33 : [ [1,2, 1,-1, 0,-1, 1,0], # "!"
],
34 : [ [0,2, 0,1],
[1,2, 1,1], # """
],
35 : [ [0,1, 2,1],
[0,0, 2,0],
[1,2, 1,-1],
[2,2, 2,-1], # "#"
],
36 : [ [2,2, 0,2, 0,1, 2,1, 2,0, 0,0],
[1,2, 1,-1], # "$"
],
37 : [ [2,2, 0,0],
[0,2, 0,1],
[2,0, 2,1], # "%"
],
38 : [ [2,0, 0,0, 0,1, 1,2, 0,2, 2,-1] # "&"
],
39 : [ [1,2, 0,1], # "'"
],
40 : [ [1,2, 0,1, 0,0, 1,-1], # "("
],
41 : [ [1,2, 2,1, 2,0, 1,-1], # ")"
],
42 : [ [0,0, 2,2],
[2,0, 0,2],
[0,1, 2,1], # "*"
],
43 : [ [1,0, 1,2], # "+"
[0,1, 2,1],
],
44 : [ [1,0, 0,-1], # ","
],
45 : [ [0,1, 2,1], # "-"
],
46 : [ [0,0, 0,-1], # "."
],
47 : [ [0,0, 2,2], # "/"
],
48 : [ [0,0, 2,0, 2,2, 0,2, 0,0], # "0"
],
49 : [ [1,0, 1,2], # "1"
],
50 : [ [0,2, 2,2, 2,1, 0,1, 0,0, 2,0], # "2"
],
51 : [ [0,2, 2,2, 2,0, 0,0],
[0,1, 2,1], # "3"
],
52 : [ [0,2, 0,1, 2,1],
[2,2, 2,0], # "4"
],
53 : [ [2,2, 0,2, 0,1, 2,1, 2,0, 0,0], # "5"
],
54 : [ [0,2, 0,0, 2,0, 2,1, 0,1], # "6"
],
55 : [ [ 0,2, 2,2, 2,0], # "7"
],
56 : [ [0,0, 2,0, 2,2, 0,2, 0,0],
[0,1, 2,1], # "8"
],
57 : [ [2,1, 0,1, 0,2, 2,2, 2,0], # "9"
],
58 : [ [1,2, 1,1],
[1,0, 1,-1] # ":"
],
59 : [ [1,2, 1,1],
[1,0, 0,-1], # ";"
],
60 : [ [2,2, 0,1, 2,0] # "<"
],
61 : [ [0,1, 2,1],
[0,0, 2,0], # "="
],
62 : [ [0,2, 2,1, 0,0], # ">"
],
63 : [ [1,0, 1,1, 2,1, 2,2, 0,2, 0,1], # "?"
],
64 : [ [2,-1, 0,-1, 0,2, 2,2, 2,0, 1,0, 1,1, 2,1], # "@"
],
65 : [ [0,0, 0,2, 2,2, 2,0],
[0,1, 2,1], # "A"
],
66 : [ [0,0, 0,2, 1,2, 1,1, 2,1, 2,0, 0,0],
[0,1, 1,1], # "B"
],
67 : [ [2,0, 0,0, 0,2, 2,2] # "C"
],
68 : [ [0,0, 0,2, 1,2, 2,1, 1,0, 0,0], # "D"
],
69 : [ [2,0, 0,0, 0,2, 2,2],
[0,1, 1,1], # "E"
],
70 : [ [0,0, 0,2, 2,2],
[0,1, 1,1], # "F"
],
71 : [ [2,2, 0,2, 0,0, 2,0, 2,1, 1,1], # "G"
],
72 : [ [0,0, 0,2],
[2,0, 2,2],
[0,1, 2,1], # "H"
],
73 : [ [1,0, 1,2], # "I"
],
74 : [ [2,2, 2,0, 0,0, 0,1], # "J"
],
75 : [ [0,0, 0,2],
[2,2, 1,1, 2,0],
[0,1, 1,1], # "K"
],
76 : [ [0,2, 0,0, 2,0], # "L"
],
77 : [ [0,0, 0,2, 1,1, 2,2, 2,0], # "M"
],
78 : [ [0,0, 0,2, 2,0, 2,2], # "N"
],
79 : [ [0,0, 2,0, 2,2, 0,2, 0,0], # "O"
],
80 : [ [0,0, 0,2, 2,2, 2,1, 0,1], # "P"
],
81 : [ [0,0, 2,0, 2,2, 0,2, 0,0],
[ 1,1, 2,0], # "Q"
],
82 : [ [0,0, 0,2, 2,2, 2,1, 0,1],
[1,1, 2,0], # "R"
],
83 : [ [2,2, 0,2, 0,1, 2,1, 2,0, 0,0], # "S"
],
84 : [ [0,2, 2,2],
[1,0, 1,2], # "T"
],
85 : [ [0,2, 0,0, 2,0, 2,2], # "U"
],
86 : [ [0,2, 1,0, 2,2], # "V"
],
87 : [ [0,2, 0,0, 1,1, 2,0, 2,2], # "W"
],
88 : [ [0,2, 2,0],
[0,0, 2,2], # "X"
],
89 : [ [0,2, 1,1, 2,2],
[1,0, 1,1], # ""
],
90 : [ [0,2, 2,2, 0,0, 2,0], # "Z"
],
91 : [ [1,0, 0,0, 0,2, 1,2], # "["
],
92 : [ [0,2, 2,0], # "\"
],
93 : [ [1,2, 2,2, 2,0, 1,0], # "]"
],
94 : [ [0,1, 1,2, 2,1], # "^"
],
95 : [ [0,0, 2,0], # "_"
],
96 : [ [0,2, 1,1], # "`"
],
#---------Small English
97 : [ [2,0, 0,0, 0,1, 1,1, 1,0],
[1,1, 1,2, 0,2], # "a"
],
98 : [ [0,2, 0,0, 1,0, 1,1, 0,1] # "b"
],
99 : [ [1,1, 0,1, 0,0, 1,0], # "c"
],
100 : [ [1,2, 1,0, 0,0, 0,1, 1,1], # "d"
],
101 : [ [1,0, 0,0, 0,1, 1,2, 1,1, 0,1], # "e"
],
102 : [ [1,0, 1,1, 2,2, 2,1, 0,1], # "f"
],
103 : [ [1,0, 0,0, 0,1, 1,1, 1,-1, 0,-1], # "g"
],
104 : [ [0,2, 0,0],
[0,1, 1,1, 1,0], # "h"
],
105 : [ [1,0, 1,1], # "i"
],
106 : [ [1,1, 1,-1, 0,-1, 0,0], # "j"
],
107 : [ [0,0, 0,2],
[1,0, 0,1, 1,1], # "k"
],
108 : [ [0,1, 1,2, 1,0], # "l"
],
109 : [ [0,0, 0,1, 2,1, 2,0],
[1,0, 1,1], # "m"
],
110 : [ [0,0, 0,1, 1,1, 1,0], # "n"
],
111 : [ [0,0, 0,1, 1,1, 1,0, 0,0] # "o"
],
112 : [ [0,0, 1,0, 1,1, 0,1, 0,-1], # "p"
],
113 : [ [1,0, 0,0, 0,1, 1,1, 1,-1], # "q"
],
114 : [ [0,0, 0,1, 1,1], # "r"
],
115 : [ [1,1, 0,1, 1,0, 0,0], # "s"
],
116 : [ [2,0, 1,0, 1,2],
[0,1, 2,1], # "t"
],
117 : [ [0,1, 0,0, 1,0, 1,1], # "u"
],
118 : [ [0,1, 0,0, 1,1], # "v"
],
119 : [ [0,1, 0,0, 2,0, 2,1],
[1,1, 1,0], # "w"
],
120 : [ [0,1, 1,0],
[0,0, 1,1] # "x"
],
121 : [ [0,1, 0,0, 1,0, 1,1],
[1,0, 1,-1, 0,-1] # "y"
],
122 : [ [0,1, 1,1, 0,0, 1,0], # "z"
],
123 : [ [2,2, 1,2, 1,0, 2,0],
[0,1, 1,1], # "{"
],
124 : [ [1,0,1,2], # "|"
],
125 : [ [0,2, 1,2, 1,0, 0,0],
[1,1, 2,1], # "}"
],
126 : [ [0,1, 0,2, 1,2, 1,1, 2,1, 2,2], # "~"
],
127 : [ [0,0, 2,0, 2,1, 0,1, 0,0],
[1,0, 1,1], # "infinity symbol"
],
128 : [ [2,-1, 1,0, 1,1, 2,2],
[0,1, 2,1],
[0,0, 2,0], # "Euro symbol"
],
162 : 65, # ""
183 : [ [0,2, 0,1], # ""
],
184 : 69, # ""
185 : 72, # ""
186 : [ [1,0, 1,2],
[0,2, 0,1], # ""
],
187 : [ [0,2, 1,1, 0,0],
[1,2, 2,1, 1,0], # ""
],
188 : 79, # ""
189 : [ [0,2, 0,1],
[1,2, 0,-1],
[1,1, 2,1, 2,0, 1,0, 1,-1, 2,-1], # ""
],
190 : 89, # ""
191 : 217, # ""
192 : 233, # ""
#-----Greek capital
193 : 65, # ""
194 : 66, # ""
195 : [ [0,0, 0,2, 2,2], # ""
],
196 : [ [0,0, 1,2, 2,0, 0,0], # ""
],
197 : 69, # ""
198 : 90, # ""
199 : 72, # ""
200 : [ [0,1, 1,2, 2,1, 1,0, 0,1],
[0,1, 2,1], # ""
],
201 : 73, # ""
202 : 75, # ""
203 : [ [0,0, 1,2, 2,0], # ""
],
204 : 77, # ""
205 : 78, # ""
206 : [ [0,0, 2,0],
[0,2, 2,2],
[0,1, 2,1], # ""
],
207 : 79, # ""
208 : [ [0,0, 0,2, 2,2, 2,0], # ""
],
209 : 80, # ""
210 : 63, # Not defined
211 : [ [2,2, 0,2, 1,1, 0,0, 2,0], # ""
],
212 : 84, # ""
213 : 89, # ""
214 : [ [0,1, 2,1, 2,2, 0,2, 0,1],
[1,2, 1,0], # ""
],
215 : 88, # ""
216 : [ [0,2, 0,1, 2,1, 2,2],
[1,2, 1,0], # ""
],
217 : [ [0,1, 2,1, 2,2, 0,2, 0,1],
[1,1, 1,0],
[0,0, 2,0], # ""
],
#----------Not defined
218 : 201, # ""
219 : 89, # ""
220 : 225, # ""
221 : 229, # ""
222 : 231, # ""
223 : 233, # ""
224 : 245, # ""
#----------Small Greek letters
225 : [ [2,0, 0,0, 0,1, 1,1, 1,0], # ""
],
226 : [ [0,0, 1,0, 1,1, 0,1, 0,-1],
[0,1, 0,2, 1,2, 0,1], # ""
],
227 : [ [0,1, 1,0, 1,-1, 0,-1, 0,0, 1,1], # ""
],
228 : [ [1,1, 0,1, 0,0, 1,0, 1,1, 0,2, 1,2], # ""
],
229 : [ [1,2, 0,1, 1,0],
[0,1, 1,1], # ""
],
230 : [ [0,2, 1,2, 0,1, 1,0, 0,-1], # ""
],
231 : [ [0,0, 0,1, 1,1, 1,-1], # ""
],
232 : [ [0,0, 1,0, 1,2, 0,2, 0,0],
[0,1, 1,1] # ""
],
233 : [ [ 1,0, 1,1], # ""
],
234 : 107, # ""
235 : [ [0,0, 1,1],
[1,0, 1,2, 0,2], # ""
],
236 : [ [0,1, 0,-1],
[0,0, 1,0, 1,1], # ""
],
237 : 118, # ""
238 : [ [0,2, 1,2, 0,1, 1,1, 0,0, 1,0, 1,-1], # ""
],
239 : 111, # ""
240 : [ [0,0, 0,1, 1,1, 1,0], # ""
],
241 : 112, # ""
242 : [ [1,1, 0,1, 0,0, 1,0, 1,-1, 0,-1], # ""
],
243 : [ [1,1, 1,0, 0,0, 0,1, 2,1], # ""
],
244 : [ [0,1, 2,1],
[1,1, 1,0, 2,0], # ""
],
245 : 117, # ""
246 : [ [0,1, 0,0, 2,0, 2,1, 1,1, 1,-1], # ""
],
247 : [ [0,1, 1,-1],
[1,1, 0,-1], # ""
],
248 : [ [0,1, 0,0, 2,0, 2,1],
[1,1, 1,-1], # ""
],
249 : 119, # ""
250 : 233, # ""
251 : 245, # ""
252 : 239, # ""
253 : 245, # ""
254 : 249, # ""
255 : 239, # quadrilateral
}
for lines in dilines.itervalues():
if type(lines) == IntType: continue
for li in lines:
for i in xrange(0, len(li), 2): li[i] *= 0.75
lines.append([(2, 0)])
return dilines
thanFonts["thanprime1"] = ThanFontLine("thanprime1", (0,0), (6,7), (0,-2), False, makePrime1Lines())
thanFonts["thanprime2"] = ThanFontLine("thanprime2", (0,0), (6,7), (0,-2), False, makePrime2Lines())
thanFonts["thanlcd1"] = ThanFontLine("thanlcd1", (0,0), (2,2), (0,-1), False, makeLcd1Lines())
if __name__ == "__main__":
print __doc__
thanFonts["thanprime1"].thanExportTxt(open("pr1.txf", "w"))
# for k,dilines in thanFonts["thanlcd1"].thanDilines.iteritems():
# print k, ':', dilines
|