bcrg 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
bcrg-1.0.0/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
bcrg-1.0.0/MANIFEST.in ADDED
@@ -0,0 +1 @@
1
+ include bcrg/*.lua
bcrg-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.1
2
+ Name: bcrg
3
+ Version: 1.0.0
4
+ Summary: Ballistics reticle generator
5
+ Project-URL: Homepage, https://github.com/o-murphy/bcrg
6
+ Project-URL: Bug Reports, https://github.com/o-murphy/bcrg/issues
7
+ Project-URL: Source, https://github.com/o-murphy/bcrg
8
+ Keywords: ballistics,reticles,lua,luascript,python,python3
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Natural Language :: English
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.7
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Operating System :: OS Independent
22
+ Classifier: Programming Language :: Python :: Implementation :: CPython
23
+ Requires-Python: >=3.7
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: lupa
27
+
28
+ # BCRG - Ballistic reticle generator
29
+ ### Simple tool to generate dynamic ballistics reticles by .lua templates
30
+
31
+ ## Installation
32
+ ```bash
33
+ pip install bcrg
34
+ ```
35
+
36
+ ## Usage
37
+
38
+ ### As CLI tool
39
+ ```bash
40
+ python -m bcrg
41
+ usage: bcr [-h] [-o OUTPUT] [-W <int>] [-H <int>] [-cx <float>] [-cy <float>] [-z [<int> ...]] [-Z] file
42
+
43
+ positional arguments:
44
+ file Reticle template file in .lua format
45
+
46
+ options:
47
+ -h, --help show this help message and exit
48
+ -o OUTPUT, --output OUTPUT
49
+ Output directory path, defaults to ./
50
+ -W <int>, --width <int>
51
+ Canvas width (px)
52
+ -H <int>, --height <int>
53
+ Canvas height (px)
54
+ -cx <float>, --click-x <float>
55
+ Horizontal click size (cm/100m)
56
+ -cy <float>, --click-y <float>
57
+ Vertical click size (cm/100m)
58
+ -z [<int> ...], --zoom [<int> ...]
59
+ Zoom value (int)
60
+ -Z, --zip Store as .zip
61
+
62
+ ```
63
+
64
+ ### As Imported module
65
+ ```python
66
+ from bcrg import LuaReticleLoader
67
+ loader = LuaReticleLoader('my_reticle_template.lua')
68
+
69
+ # Create 1bit-depth .bmp bytearray
70
+ byte_stream = loader.make_bmp(640, 480, 2.27, 2.27, 4, None)
71
+ with open("myreticle.bmp", 'b') as f:
72
+ f.write(byte_stream)
73
+ ```
74
+
75
+ [//]: # (# Create direct bytearray from lua framebuffer )
76
+
77
+ [//]: # (byte_stream = loader.make_buf&#40;640, 480, 2.27, 2.27, 4, None&#41;)
78
+
79
+ ### References
80
+ * A reticle template have to implement `make_reticle` function, that gets required arguments and have to return `self:to_bmp` or `self:to_bmp_1bit`
81
+ * Examples in ./templates dir
82
+
83
+
bcrg-1.0.0/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # BCRG - Ballistic reticle generator
2
+ ### Simple tool to generate dynamic ballistics reticles by .lua templates
3
+
4
+ ## Installation
5
+ ```bash
6
+ pip install bcrg
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ ### As CLI tool
12
+ ```bash
13
+ python -m bcrg
14
+ usage: bcr [-h] [-o OUTPUT] [-W <int>] [-H <int>] [-cx <float>] [-cy <float>] [-z [<int> ...]] [-Z] file
15
+
16
+ positional arguments:
17
+ file Reticle template file in .lua format
18
+
19
+ options:
20
+ -h, --help show this help message and exit
21
+ -o OUTPUT, --output OUTPUT
22
+ Output directory path, defaults to ./
23
+ -W <int>, --width <int>
24
+ Canvas width (px)
25
+ -H <int>, --height <int>
26
+ Canvas height (px)
27
+ -cx <float>, --click-x <float>
28
+ Horizontal click size (cm/100m)
29
+ -cy <float>, --click-y <float>
30
+ Vertical click size (cm/100m)
31
+ -z [<int> ...], --zoom [<int> ...]
32
+ Zoom value (int)
33
+ -Z, --zip Store as .zip
34
+
35
+ ```
36
+
37
+ ### As Imported module
38
+ ```python
39
+ from bcrg import LuaReticleLoader
40
+ loader = LuaReticleLoader('my_reticle_template.lua')
41
+
42
+ # Create 1bit-depth .bmp bytearray
43
+ byte_stream = loader.make_bmp(640, 480, 2.27, 2.27, 4, None)
44
+ with open("myreticle.bmp", 'b') as f:
45
+ f.write(byte_stream)
46
+ ```
47
+
48
+ [//]: # (# Create direct bytearray from lua framebuffer )
49
+
50
+ [//]: # (byte_stream = loader.make_buf&#40;640, 480, 2.27, 2.27, 4, None&#41;)
51
+
52
+ ### References
53
+ * A reticle template have to implement `make_reticle` function, that gets required arguments and have to return `self:to_bmp` or `self:to_bmp_1bit`
54
+ * Examples in ./templates dir
55
+
56
+
@@ -0,0 +1,41 @@
1
+ from pathlib import Path
2
+
3
+ from lupa import LuaRuntime
4
+
5
+ _LIB_ROOT = Path(__file__).parent.as_posix()
6
+
7
+
8
+ class LuaReticleLoader:
9
+ def __init__(self, filename: str = 'main.lua'):
10
+ self._make_reticle = None
11
+ self._get_buffer = None
12
+ self._lua = LuaRuntime(unpack_returned_tuples=True)
13
+ self._load(filename)
14
+
15
+ @staticmethod
16
+ def _unpack_lua_table(table):
17
+ return [int(table[i]) for i in range(1, len(table) + 1)]
18
+
19
+ def _load(self, filename: str) -> None:
20
+ # Set the Lua package path
21
+ self._lua.execute(f"""
22
+ package.path = package.path .. ";./?.lua;{_LIB_ROOT}/?.lua"
23
+ """)
24
+
25
+ # Load the Lua script
26
+ with open(filename, 'r') as lua_file:
27
+ lua_code = lua_file.read()
28
+ self._lua.execute(lua_code)
29
+ # Get the function from Lua
30
+ self._get_buffer = self._lua.globals().get_buffer
31
+ self._make_reticle = self._lua.globals().make_reticle
32
+
33
+ def make_bmp(self, width, height, click_x, click_y, zoom, adjustment) -> bytes:
34
+ if self._make_reticle is not None:
35
+ table = self._make_reticle(width, height, click_x, click_y, zoom, adjustment)
36
+ return bytes(self._unpack_lua_table(table))
37
+
38
+ def make_buf(self, width, height, click_x, click_y, zoom, adjustment) -> bytes:
39
+ if self._make_reticle is not None:
40
+ table = self._make_reticle(width, height, click_x, click_y, zoom, adjustment)
41
+ return bytes(self._unpack_lua_table(table))
@@ -0,0 +1,113 @@
1
+ import argparse
2
+ import io
3
+ import os
4
+ import sys
5
+ import zipfile
6
+ from pathlib import Path
7
+
8
+ from bcrg import LuaReticleLoader
9
+
10
+
11
+ def store_to_zip(file_data_dict, output_filename):
12
+ with io.BytesIO() as byte_stream:
13
+ with zipfile.ZipFile(byte_stream, 'w', zipfile.ZIP_DEFLATED) as zipf:
14
+ for filename, data in file_data_dict.items():
15
+ zipf.writestr(filename, data)
16
+
17
+ # Write the in-memory ZIP archive to a file
18
+ with open(output_filename, 'wb') as f:
19
+ f.write(byte_stream.getvalue())
20
+
21
+
22
+ def store_to_dir(file_data_dict, output_dirname):
23
+ os.makedirs(output_dirname, exist_ok=True)
24
+
25
+ for name, data in file_data_dict.items():
26
+ # Save the bytearray to a BMP file
27
+ with open(Path(output_dirname, name), "wb") as bmp_file:
28
+ bmp_file.write(data)
29
+
30
+
31
+ def main():
32
+
33
+ def is_dir(string):
34
+ if Path(string).is_dir():
35
+ return string
36
+ else:
37
+ parser.error(f"'{string}' is not a valid output path")
38
+
39
+ def is_ext_exp(extensions):
40
+ def check_extension(filename):
41
+ if Path(filename).is_dir():
42
+ parser.error(f"Expected file, but '{filename}' is dir")
43
+ if not Path(filename).is_file():
44
+ parser.error(f"File not found '{filename}'")
45
+
46
+ ext = Path(filename).suffix.lower()
47
+
48
+ if ext not in extensions:
49
+ parser.error(f"File doesn't have one of the expected extensions: {', '.join(extensions)}")
50
+ return filename
51
+
52
+ return check_extension
53
+
54
+ parser = argparse.ArgumentParser(prog="bcr", exit_on_error=False)
55
+ # parser.add_argument("file", action='store', type=argparse.FileType('r'),
56
+ parser.add_argument("file", action='store', type=is_ext_exp({'.lua'}),
57
+ help="Reticle template file in .lua format")
58
+ parser.add_argument('-o', '--output', action='store', type=is_dir, default="./",
59
+ help="Output directory path, defaults to ./")
60
+ parser.add_argument('-W', '--width', action='store', default=640,
61
+ help="Canvas width (px)", type=int, metavar="<int>")
62
+ parser.add_argument('-H', '--height', action='store', default=640,
63
+ help="Canvas height (px)", type=int, metavar="<int>")
64
+ parser.add_argument('-cx', '--click-x', action='store',
65
+ help="Horizontal click size (cm/100m)", type=float, metavar="<float>")
66
+ parser.add_argument('-cy', '--click-y', action='store',
67
+ help="Vertical click size (cm/100m)", type=float, metavar="<float>")
68
+ parser.add_argument('-z', '--zoom', nargs="*", default=[1, 2, 3, 4, 6],
69
+ help="Zoom value (int)", type=int, metavar="<int>")
70
+ parser.add_argument('-Z', '--zip', action="store_true", default=False,
71
+ help="Store as .zip")
72
+
73
+ if len(sys.argv) == 1:
74
+ parser.print_help(sys.stderr)
75
+ sys.exit(1)
76
+
77
+ args = parser.parse_args()
78
+
79
+ cx, cy = args.click_x, args.click_y
80
+ if not cx and not cy:
81
+ cx, cy = 0.5, 0.5
82
+ elif not cx:
83
+ cx = cy
84
+ elif not cy:
85
+ cy = cx
86
+
87
+ loader = LuaReticleLoader(args.file)
88
+
89
+ stem = Path(args.file).stem
90
+ out_dir = f"{stem}_{cx}x{cy}"
91
+
92
+ zip_arr = {}
93
+
94
+ try:
95
+ for z in args.zoom:
96
+ bmp_bytearray = loader.make_bmp(
97
+ args.width, args.height, cx, cy, z, None
98
+ )
99
+ out_file_name = f"{z}.bmp"
100
+
101
+ zip_arr[out_file_name] = bmp_bytearray
102
+
103
+ if args.zip:
104
+ store_to_zip(zip_arr, f"{out_dir}.zip")
105
+ else:
106
+ store_to_dir(zip_arr, Path(args.output, out_dir))
107
+ except Exception as e:
108
+ print(e)
109
+ sys.exit(1)
110
+
111
+
112
+ if __name__ == '__main__':
113
+ main()
@@ -0,0 +1,203 @@
1
+ font_petme128_8x8 = {
2
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -- 32=
3
+ 0x00, 0x00, 0x00, 0x4f, 0x4f, 0x00, 0x00, 0x00, -- 33=!
4
+ 0x00, 0x07, 0x07, 0x00, 0x00, 0x07, 0x07, 0x00, -- 34="
5
+ 0x14, 0x7f, 0x7f, 0x14, 0x14, 0x7f, 0x7f, 0x14, -- 35=#
6
+ 0x00, 0x24, 0x2e, 0x6b, 0x6b, 0x3a, 0x12, 0x00, -- 36=$
7
+ 0x00, 0x63, 0x33, 0x18, 0x0c, 0x66, 0x63, 0x00, -- 37=%
8
+ 0x00, 0x32, 0x7f, 0x4d, 0x4d, 0x77, 0x72, 0x50, -- 38=&
9
+ 0x00, 0x00, 0x00, 0x04, 0x06, 0x03, 0x01, 0x00, -- 39='
10
+ 0x00, 0x00, 0x1c, 0x3e, 0x63, 0x41, 0x00, 0x00, -- 40=(
11
+ 0x00, 0x00, 0x41, 0x63, 0x3e, 0x1c, 0x00, 0x00, -- 41=)
12
+ 0x08, 0x2a, 0x3e, 0x1c, 0x1c, 0x3e, 0x2a, 0x08, -- 42=*
13
+ 0x00, 0x08, 0x08, 0x3e, 0x3e, 0x08, 0x08, 0x00, -- 43=+
14
+ 0x00, 0x00, 0x80, 0xe0, 0x60, 0x00, 0x00, 0x00, -- 44=,
15
+ 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, -- 45=-
16
+ 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, -- 46=.
17
+ 0x00, 0x40, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x02, -- 47=/
18
+ 0x00, 0x3e, 0x7f, 0x49, 0x45, 0x7f, 0x3e, 0x00, -- 48=0
19
+ 0x00, 0x40, 0x44, 0x7f, 0x7f, 0x40, 0x40, 0x00, -- 49=1
20
+ 0x00, 0x62, 0x73, 0x51, 0x49, 0x4f, 0x46, 0x00, -- 50=2
21
+ 0x00, 0x22, 0x63, 0x49, 0x49, 0x7f, 0x36, 0x00, -- 51=3
22
+ 0x00, 0x18, 0x18, 0x14, 0x16, 0x7f, 0x7f, 0x10, -- 52=4
23
+ 0x00, 0x27, 0x67, 0x45, 0x45, 0x7d, 0x39, 0x00, -- 53=5
24
+ 0x00, 0x3e, 0x7f, 0x49, 0x49, 0x7b, 0x32, 0x00, -- 54=6
25
+ 0x00, 0x03, 0x03, 0x79, 0x7d, 0x07, 0x03, 0x00, -- 55=7
26
+ 0x00, 0x36, 0x7f, 0x49, 0x49, 0x7f, 0x36, 0x00, -- 56=8
27
+ 0x00, 0x26, 0x6f, 0x49, 0x49, 0x7f, 0x3e, 0x00, -- 57=9
28
+ 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, -- 58=:
29
+ 0x00, 0x00, 0x80, 0xe4, 0x64, 0x00, 0x00, 0x00, -- 59=;
30
+ 0x00, 0x08, 0x1c, 0x36, 0x63, 0x41, 0x41, 0x00, -- 60=<
31
+ 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, -- 61==
32
+ 0x00, 0x41, 0x41, 0x63, 0x36, 0x1c, 0x08, 0x00, -- 62=>
33
+ 0x00, 0x02, 0x03, 0x51, 0x59, 0x0f, 0x06, 0x00, -- 63=?
34
+ 0x00, 0x3e, 0x7f, 0x41, 0x4d, 0x4f, 0x2e, 0x00, -- 64=@
35
+ 0x00, 0x7c, 0x7e, 0x0b, 0x0b, 0x7e, 0x7c, 0x00, -- 65=A
36
+ 0x00, 0x7f, 0x7f, 0x49, 0x49, 0x7f, 0x36, 0x00, -- 66=B
37
+ 0x00, 0x3e, 0x7f, 0x41, 0x41, 0x63, 0x22, 0x00, -- 67=C
38
+ 0x00, 0x7f, 0x7f, 0x41, 0x63, 0x3e, 0x1c, 0x00, -- 68=D
39
+ 0x00, 0x7f, 0x7f, 0x49, 0x49, 0x41, 0x41, 0x00, -- 69=E
40
+ 0x00, 0x7f, 0x7f, 0x09, 0x09, 0x01, 0x01, 0x00, -- 70=F
41
+ 0x00, 0x3e, 0x7f, 0x41, 0x49, 0x7b, 0x3a, 0x00, -- 71=G
42
+ 0x00, 0x7f, 0x7f, 0x08, 0x08, 0x7f, 0x7f, 0x00, -- 72=H
43
+ 0x00, 0x00, 0x41, 0x7f, 0x7f, 0x41, 0x00, 0x00, -- 73=I
44
+ 0x00, 0x20, 0x60, 0x41, 0x7f, 0x3f, 0x01, 0x00, -- 74=J
45
+ 0x00, 0x7f, 0x7f, 0x1c, 0x36, 0x63, 0x41, 0x00, -- 75=K
46
+ 0x00, 0x7f, 0x7f, 0x40, 0x40, 0x40, 0x40, 0x00, -- 76=L
47
+ 0x00, 0x7f, 0x7f, 0x06, 0x0c, 0x06, 0x7f, 0x7f, -- 77=M
48
+ 0x00, 0x7f, 0x7f, 0x0e, 0x1c, 0x7f, 0x7f, 0x00, -- 78=N
49
+ 0x00, 0x3e, 0x7f, 0x41, 0x41, 0x7f, 0x3e, 0x00, -- 79=O
50
+ 0x00, 0x7f, 0x7f, 0x09, 0x09, 0x0f, 0x06, 0x00, -- 80=P
51
+ 0x00, 0x1e, 0x3f, 0x21, 0x61, 0x7f, 0x5e, 0x00, -- 81=Q
52
+ 0x00, 0x7f, 0x7f, 0x19, 0x39, 0x6f, 0x46, 0x00, -- 82=R
53
+ 0x00, 0x26, 0x6f, 0x49, 0x49, 0x7b, 0x32, 0x00, -- 83=S
54
+ 0x00, 0x01, 0x01, 0x7f, 0x7f, 0x01, 0x01, 0x00, -- 84=T
55
+ 0x00, 0x3f, 0x7f, 0x40, 0x40, 0x7f, 0x3f, 0x00, -- 85=U
56
+ 0x00, 0x1f, 0x3f, 0x60, 0x60, 0x3f, 0x1f, 0x00, -- 86=V
57
+ 0x00, 0x7f, 0x7f, 0x30, 0x18, 0x30, 0x7f, 0x7f, -- 87=W
58
+ 0x00, 0x63, 0x77, 0x1c, 0x1c, 0x77, 0x63, 0x00, -- 88=X
59
+ 0x00, 0x07, 0x0f, 0x78, 0x78, 0x0f, 0x07, 0x00, -- 89=Y
60
+ 0x00, 0x61, 0x71, 0x59, 0x4d, 0x47, 0x43, 0x00, -- 90=Z
61
+ 0x00, 0x00, 0x7f, 0x7f, 0x41, 0x41, 0x00, 0x00, -- 91=[
62
+ 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x40, -- 92='\'
63
+ 0x00, 0x00, 0x41, 0x41, 0x7f, 0x7f, 0x00, 0x00, -- 93=]
64
+ 0x00, 0x08, 0x0c, 0x06, 0x06, 0x0c, 0x08, 0x00, -- 94=^
65
+ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -- 95=_
66
+ 0x00, 0x00, 0x01, 0x03, 0x06, 0x04, 0x00, 0x00, -- 96=`
67
+ 0x00, 0x20, 0x74, 0x54, 0x54, 0x7c, 0x78, 0x00, -- 97=a
68
+ 0x00, 0x7f, 0x7f, 0x44, 0x44, 0x7c, 0x38, 0x00, -- 98=b
69
+ 0x00, 0x38, 0x7c, 0x44, 0x44, 0x6c, 0x28, 0x00, -- 99=c
70
+ 0x00, 0x38, 0x7c, 0x44, 0x44, 0x7f, 0x7f, 0x00, -- 100=d
71
+ 0x00, 0x38, 0x7c, 0x54, 0x54, 0x5c, 0x58, 0x00, -- 101=e
72
+ 0x00, 0x08, 0x7e, 0x7f, 0x09, 0x03, 0x02, 0x00, -- 102=f
73
+ 0x00, 0x98, 0xbc, 0xa4, 0xa4, 0xfc, 0x7c, 0x00, -- 103=g
74
+ 0x00, 0x7f, 0x7f, 0x04, 0x04, 0x7c, 0x78, 0x00, -- 104=h
75
+ 0x00, 0x00, 0x00, 0x7d, 0x7d, 0x00, 0x00, 0x00, -- 105=i
76
+ 0x00, 0x40, 0xc0, 0x80, 0x80, 0xfd, 0x7d, 0x00, -- 106=j
77
+ 0x00, 0x7f, 0x7f, 0x30, 0x38, 0x6c, 0x44, 0x00, -- 107=k
78
+ 0x00, 0x00, 0x41, 0x7f, 0x7f, 0x40, 0x00, 0x00, -- 108=l
79
+ 0x00, 0x7c, 0x7c, 0x18, 0x30, 0x18, 0x7c, 0x7c, -- 109=m
80
+ 0x00, 0x7c, 0x7c, 0x04, 0x04, 0x7c, 0x78, 0x00, -- 110=n
81
+ 0x00, 0x38, 0x7c, 0x44, 0x44, 0x7c, 0x38, 0x00, -- 111=o
82
+ 0x00, 0xfc, 0xfc, 0x24, 0x24, 0x3c, 0x18, 0x00, -- 112=p
83
+ 0x00, 0x18, 0x3c, 0x24, 0x24, 0xfc, 0xfc, 0x00, -- 113=q
84
+ 0x00, 0x7c, 0x7c, 0x04, 0x04, 0x0c, 0x08, 0x00, -- 114=r
85
+ 0x00, 0x48, 0x5c, 0x54, 0x54, 0x74, 0x20, 0x00, -- 115=s
86
+ 0x04, 0x04, 0x3f, 0x7f, 0x44, 0x64, 0x20, 0x00, -- 116=t
87
+ 0x00, 0x3c, 0x7c, 0x40, 0x40, 0x7c, 0x3c, 0x00, -- 117=u
88
+ 0x00, 0x1c, 0x3c, 0x60, 0x60, 0x3c, 0x1c, 0x00, -- 118=v
89
+ 0x00, 0x1c, 0x7c, 0x30, 0x18, 0x30, 0x7c, 0x1c, -- 119=w
90
+ 0x00, 0x44, 0x6c, 0x38, 0x38, 0x6c, 0x44, 0x00, -- 120=x
91
+ 0x00, 0x9c, 0xbc, 0xa0, 0xa0, 0xfc, 0x7c, 0x00, -- 121=y
92
+ 0x00, 0x44, 0x64, 0x74, 0x5c, 0x4c, 0x44, 0x00, -- 122=z
93
+ 0x00, 0x08, 0x08, 0x3e, 0x77, 0x41, 0x41, 0x00, -- 123=(
94
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, -- 124=|
95
+ 0x00, 0x41, 0x41, 0x77, 0x3e, 0x08, 0x08, 0x00, -- 125=)
96
+ 0x00, 0x02, 0x03, 0x01, 0x03, 0x02, 0x03, 0x01, -- 126=~
97
+ 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, -- 127
98
+ }
99
+
100
+
101
+ font_128_6x6 = {
102
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -- 32=
103
+ 0x00, 0x4f, 0x4f, 0x00, 0x00, 0x00, -- 33=!
104
+ 0x07, 0x00, 0x00, 0x07, 0x07, 0x00, -- 34="
105
+ 0x7f, 0x14, 0x14, 0x7f, 0x7f, 0x14, -- 35=#
106
+ 0x2e, 0x6b, 0x6b, 0x3a, 0x12, 0x00, -- 36=$
107
+ 0x33, 0x18, 0x0c, 0x66, 0x63, 0x00, -- 37=%
108
+ 0x7f, 0x4d, 0x4d, 0x77, 0x72, 0x50, -- 38=&
109
+ 0x00, 0x04, 0x06, 0x03, 0x01, 0x00, -- 39='
110
+ 0x1c, 0x3e, 0x63, 0x41, 0x00, 0x00, -- 40=(
111
+ 0x41, 0x63, 0x3e, 0x1c, 0x00, 0x00, -- 41=)
112
+ 0x3e, 0x1c, 0x1c, 0x3e, 0x2a, 0x08, -- 42=*
113
+ 0x08, 0x3e, 0x3e, 0x08, 0x08, 0x00, -- 43=+
114
+ 0x80, 0xe0, 0x60, 0x00, 0x00, 0x00, -- 44=,
115
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, -- 45=-
116
+ 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, -- 46=.
117
+ 0x60, 0x30, 0x18, 0x0c, 0x06, 0x02, -- 47=/
118
+
119
+ 0x3f, 0x21, 0x21, 0x21, 0x3f, 0x00, -- 48=0
120
+ 0x00, 0x01, 0x3f, 0x00, 0x00, 0x00, -- 49=1
121
+ 0x33, 0x31, 0x29, 0x25, 0x33, 0x00, -- 50=2
122
+ 0x33, 0x21, 0x25, 0x25, 0x3b, 0x00, -- 51=3
123
+ 0x1f, 0x10, 0x10, 0x10, 0x3f, 0x00, -- 52=4
124
+ --0x18, 0x14, 0x12, 0x3f, 0x10, 0x00, -- 52=4
125
+ --0x27, 0x25, 0x25, 0x25, 0x1d, 0x00, -- 53=5
126
+ 0x27, 0x25, 0x25, 0x25, 0x3d, 0x00, -- 53=5
127
+ --0x1e, 0x25, 0x25, 0x25, 0x19, 0x00, -- 54=6
128
+ 0x3c, 0x2a, 0x29, 0x29, 0x38, 0x00, -- 54=6
129
+ 0x03, 0x01, 0x31, 0x0d, 0x03, 0x00, -- 55=7
130
+ 0x3b, 0x25, 0x25, 0x25, 0x3b, 0x00, -- 56=8
131
+ 0x07, 0x25, 0x25, 0x15, 0x0f, 0x00, -- 57=9
132
+
133
+ 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, -- 58=:
134
+ 0x80, 0xe4, 0x64, 0x00, 0x00, 0x00, -- 59=;
135
+ 0x1c, 0x36, 0x63, 0x41, 0x41, 0x00, -- 60=<
136
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, -- 61==
137
+ 0x41, 0x63, 0x36, 0x1c, 0x08, 0x00, -- 62=>
138
+ 0x03, 0x51, 0x59, 0x0f, 0x06, 0x00, -- 63=?
139
+ 0x7f, 0x41, 0x4d, 0x4f, 0x2e, 0x00, -- 64=@
140
+ 0x7e, 0x0b, 0x0b, 0x7e, 0x7c, 0x00, -- 65=A
141
+ 0x7f, 0x49, 0x49, 0x7f, 0x36, 0x00, -- 66=B
142
+ 0x7f, 0x41, 0x41, 0x63, 0x22, 0x00, -- 67=C
143
+ 0x7f, 0x41, 0x63, 0x3e, 0x1c, 0x00, -- 68=D
144
+ 0x7f, 0x49, 0x49, 0x41, 0x41, 0x00, -- 69=E
145
+ 0x7f, 0x09, 0x09, 0x01, 0x01, 0x00, -- 70=F
146
+ 0x7f, 0x41, 0x49, 0x7b, 0x3a, 0x00, -- 71=G
147
+ 0x7f, 0x08, 0x08, 0x7f, 0x7f, 0x00, -- 72=H
148
+ 0x41, 0x7f, 0x7f, 0x41, 0x00, 0x00, -- 73=I
149
+ 0x60, 0x41, 0x7f, 0x3f, 0x01, 0x00, -- 74=J
150
+ 0x7f, 0x1c, 0x36, 0x63, 0x41, 0x00, -- 75=K
151
+ 0x7f, 0x40, 0x40, 0x40, 0x40, 0x00, -- 76=L
152
+ 0x7f, 0x06, 0x0c, 0x06, 0x7f, 0x7f, -- 77=M
153
+ 0x7f, 0x0e, 0x1c, 0x7f, 0x7f, 0x00, -- 78=N
154
+ 0x7f, 0x41, 0x41, 0x7f, 0x3e, 0x00, -- 79=O
155
+ 0x7f, 0x09, 0x09, 0x0f, 0x06, 0x00, -- 80=P
156
+ 0x3f, 0x21, 0x61, 0x7f, 0x5e, 0x00, -- 81=Q
157
+ 0x7f, 0x19, 0x39, 0x6f, 0x46, 0x00, -- 82=R
158
+ 0x6f, 0x49, 0x49, 0x7b, 0x32, 0x00, -- 83=S
159
+ 0x01, 0x7f, 0x7f, 0x01, 0x01, 0x00, -- 84=T
160
+ 0x7f, 0x40, 0x40, 0x7f, 0x3f, 0x00, -- 85=U
161
+ 0x3f, 0x60, 0x60, 0x3f, 0x1f, 0x00, -- 86=V
162
+ 0x7f, 0x30, 0x18, 0x30, 0x7f, 0x7f, -- 87=W
163
+ 0x77, 0x1c, 0x1c, 0x77, 0x63, 0x00, -- 88=X
164
+ 0x0f, 0x78, 0x78, 0x0f, 0x07, 0x00, -- 89=Y
165
+ 0x71, 0x59, 0x4d, 0x47, 0x43, 0x00, -- 90=Z
166
+ 0x7f, 0x7f, 0x41, 0x41, 0x00, 0x00, -- 91=[
167
+ 0x06, 0x0c, 0x18, 0x30, 0x60, 0x40, -- 92='\'
168
+ 0x41, 0x41, 0x7f, 0x7f, 0x00, 0x00, -- 93=]
169
+ 0x0c, 0x06, 0x06, 0x0c, 0x08, 0x00, -- 94=^
170
+ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, -- 95=_
171
+ 0x01, 0x03, 0x06, 0x04, 0x00, 0x00, -- 96=`
172
+ 0x74, 0x54, 0x54, 0x7c, 0x78, 0x00, -- 97=a
173
+ 0x7f, 0x44, 0x44, 0x7c, 0x38, 0x00, -- 98=b
174
+ 0x7c, 0x44, 0x44, 0x6c, 0x28, 0x00, -- 99=c
175
+ 0x7c, 0x44, 0x44, 0x7f, 0x7f, 0x00, -- 100=d
176
+ 0x7c, 0x54, 0x54, 0x5c, 0x58, 0x00, -- 101=e
177
+ 0x7e, 0x7f, 0x09, 0x03, 0x02, 0x00, -- 102=f
178
+ 0xbc, 0xa4, 0xa4, 0xfc, 0x7c, 0x00, -- 103=g
179
+ 0x7f, 0x04, 0x04, 0x7c, 0x78, 0x00, -- 104=h
180
+ 0x00, 0x7d, 0x7d, 0x00, 0x00, 0x00, -- 105=i
181
+ 0xc0, 0x80, 0x80, 0xfd, 0x7d, 0x00, -- 106=j
182
+ 0x7f, 0x30, 0x38, 0x6c, 0x44, 0x00, -- 107=k
183
+ 0x41, 0x7f, 0x7f, 0x40, 0x00, 0x00, -- 108=l
184
+ 0x7c, 0x18, 0x30, 0x18, 0x7c, 0x7c, -- 109=m
185
+ 0x7c, 0x04, 0x04, 0x7c, 0x78, 0x00, -- 110=n
186
+ 0x7c, 0x44, 0x44, 0x7c, 0x38, 0x00, -- 111=o
187
+ 0xfc, 0x24, 0x24, 0x3c, 0x18, 0x00, -- 112=p
188
+ 0x3c, 0x24, 0x24, 0xfc, 0xfc, 0x00, -- 113=q
189
+ 0x7c, 0x04, 0x04, 0x0c, 0x08, 0x00, -- 114=r
190
+ 0x5c, 0x54, 0x54, 0x74, 0x20, 0x00, -- 115=s
191
+ 0x3f, 0x7f, 0x44, 0x64, 0x20, 0x00, -- 116=t
192
+ 0x7c, 0x40, 0x40, 0x7c, 0x3c, 0x00, -- 117=u
193
+ 0x3c, 0x60, 0x60, 0x3c, 0x1c, 0x00, -- 118=v
194
+ 0x7c, 0x30, 0x18, 0x30, 0x7c, 0x1c, -- 119=w
195
+ 0x6c, 0x38, 0x38, 0x6c, 0x44, 0x00, -- 120=x
196
+ 0xbc, 0xa0, 0xa0, 0xfc, 0x7c, 0x00, -- 121=y
197
+ 0x64, 0x74, 0x5c, 0x4c, 0x44, 0x00, -- 122=z
198
+ 0x08, 0x3e, 0x77, 0x41, 0x41, 0x00, -- 123=(
199
+ 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, -- 124=|
200
+ 0x41, 0x77, 0x3e, 0x08, 0x08, 0x00, -- 125=)
201
+ 0x03, 0x01, 0x03, 0x02, 0x03, 0x01, -- 126=~
202
+ 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, -- 127
203
+ }