forked from nanoframework/nanoFramework.IoT.Device
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Thin8x8.cs
137 lines (132 loc) · 8.13 KB
/
Thin8x8.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// File Automatically Generated by Bitmap2Font
using System;
namespace Iot.Device.Ssd13xx
{
/// <summary>
/// Thin8x8 font.
/// </summary>
public class Thin8x8 : IFont
{
private static readonly byte[][] _fontTable =
{
new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
new byte[] { 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00 },
new byte[] { 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
new byte[] { 0x24, 0x24, 0xFF, 0x24, 0x24, 0xFF, 0x24, 0x24 },
new byte[] { 0x08, 0x3C, 0x0A, 0x1C, 0x28, 0x1E, 0x08, 0x00 },
new byte[] { 0x00, 0x00, 0x24, 0x10, 0x08, 0x24, 0x00, 0x00 },
new byte[] { 0x08, 0x14, 0x14, 0x08, 0x14, 0x22, 0x52, 0x1C },
new byte[] { 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
new byte[] { 0x00, 0x10, 0x08, 0x04, 0x04, 0x08, 0x10, 0x00 },
new byte[] { 0x00, 0x04, 0x08, 0x10, 0x10, 0x08, 0x04, 0x00 },
new byte[] { 0x00, 0x00, 0x2A, 0x1C, 0x3E, 0x1C, 0x2A, 0x00 },
new byte[] { 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00 },
new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04 },
new byte[] { 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00 },
new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00 },
new byte[] { 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00 },
new byte[] { 0x1C, 0x32, 0x32, 0x2A, 0x26, 0x26, 0x1C, 0x00 },
new byte[] { 0x0C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00 },
new byte[] { 0x1C, 0x22, 0x20, 0x1C, 0x02, 0x02, 0x3E, 0x00 },
new byte[] { 0x1C, 0x22, 0x20, 0x18, 0x20, 0x22, 0x1C, 0x00 },
new byte[] { 0x02, 0x0A, 0x0A, 0x0A, 0x3E, 0x08, 0x08, 0x00 },
new byte[] { 0x3E, 0x02, 0x02, 0x1E, 0x20, 0x20, 0x1E, 0x00 },
new byte[] { 0x1C, 0x02, 0x02, 0x1E, 0x22, 0x22, 0x1C, 0x00 },
new byte[] { 0x3E, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00 },
new byte[] { 0x18, 0x24, 0x24, 0x18, 0x24, 0x24, 0x18, 0x00 },
new byte[] { 0x18, 0x24, 0x24, 0x38, 0x20, 0x10, 0x08, 0x00 },
new byte[] { 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00 },
new byte[] { 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x0C, 0x0C },
new byte[] { 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00 },
new byte[] { 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00 },
new byte[] { 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00 },
new byte[] { 0x1C, 0x22, 0x22, 0x20, 0x18, 0x08, 0x00, 0x08 },
new byte[] { 0x3C, 0x42, 0x5A, 0x5A, 0x4A, 0x32, 0x7C, 0x00 },
new byte[] { 0x3E, 0x41, 0x41, 0x7F, 0x41, 0x41, 0x41, 0x00 },
new byte[] { 0x3F, 0x41, 0x41, 0x3F, 0x41, 0x41, 0x3F, 0x00 },
new byte[] { 0x7E, 0x01, 0x01, 0x01, 0x01, 0x01, 0x7E, 0x00 },
new byte[] { 0x3F, 0x41, 0x41, 0x41, 0x41, 0x41, 0x3F, 0x00 },
new byte[] { 0x7F, 0x01, 0x01, 0x0F, 0x01, 0x01, 0x7F, 0x00 },
new byte[] { 0x7F, 0x01, 0x01, 0x0F, 0x01, 0x01, 0x01, 0x00 },
new byte[] { 0x7E, 0x01, 0x01, 0x61, 0x41, 0x41, 0x3E, 0x00 },
new byte[] { 0x41, 0x41, 0x41, 0x7F, 0x41, 0x41, 0x41, 0x00 },
new byte[] { 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3E, 0x00 },
new byte[] { 0x3E, 0x08, 0x08, 0x08, 0x09, 0x09, 0x06, 0x00 },
new byte[] { 0x42, 0x22, 0x12, 0x0E, 0x12, 0x22, 0x42, 0x00 },
new byte[] { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x3E, 0x00 },
new byte[] { 0x63, 0x55, 0x49, 0x41, 0x41, 0x41, 0x41, 0x00 },
new byte[] { 0x43, 0x45, 0x49, 0x51, 0x61, 0x41, 0x41, 0x00 },
new byte[] { 0x3E, 0x41, 0x41, 0x41, 0x41, 0x41, 0x3E, 0x00 },
new byte[] { 0x3F, 0x41, 0x41, 0x3F, 0x01, 0x01, 0x01, 0x00 },
new byte[] { 0x3E, 0x41, 0x41, 0x41, 0x51, 0x61, 0x7E, 0x00 },
new byte[] { 0x3F, 0x41, 0x41, 0x3F, 0x09, 0x11, 0x21, 0x00 },
new byte[] { 0x7E, 0x01, 0x01, 0x3E, 0x40, 0x40, 0x3F, 0x00 },
new byte[] { 0x7F, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00 },
new byte[] { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x3E, 0x00 },
new byte[] { 0x41, 0x41, 0x22, 0x22, 0x14, 0x14, 0x08, 0x00 },
new byte[] { 0x41, 0x41, 0x41, 0x41, 0x49, 0x55, 0x63, 0x00 },
new byte[] { 0x41, 0x22, 0x14, 0x08, 0x14, 0x22, 0x41, 0x00 },
new byte[] { 0x41, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x00 },
new byte[] { 0x7F, 0x20, 0x10, 0x08, 0x04, 0x02, 0x7F, 0x00 },
new byte[] { 0x1C, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1C, 0x00 },
new byte[] { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00 },
new byte[] { 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00 },
new byte[] { 0x08, 0x14, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00 },
new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF },
new byte[] { 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
new byte[] { 0x00, 0x00, 0x3E, 0x21, 0x21, 0x21, 0x5E, 0x00 },
new byte[] { 0x01, 0x01, 0x3F, 0x41, 0x41, 0x41, 0x3F, 0x00 },
new byte[] { 0x00, 0x00, 0x7E, 0x01, 0x01, 0x01, 0x7E, 0x00 },
new byte[] { 0x40, 0x40, 0x7E, 0x41, 0x41, 0x41, 0x7E, 0x00 },
new byte[] { 0x00, 0x00, 0x3E, 0x41, 0x3F, 0x01, 0x7E, 0x00 },
new byte[] { 0x3C, 0x42, 0x0F, 0x02, 0x02, 0x02, 0x02, 0x00 },
new byte[] { 0x00, 0x00, 0x3E, 0x41, 0x41, 0x7E, 0x40, 0x3F },
new byte[] { 0x01, 0x01, 0x3F, 0x41, 0x41, 0x41, 0x41, 0x00 },
new byte[] { 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x18, 0x00 },
new byte[] { 0x20, 0x00, 0x20, 0x20, 0x20, 0x20, 0x22, 0x1C },
new byte[] { 0x02, 0x12, 0x0A, 0x06, 0x0A, 0x12, 0x22, 0x00 },
new byte[] { 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x38, 0x00 },
new byte[] { 0x00, 0x00, 0x36, 0x49, 0x49, 0x41, 0x41, 0x00 },
new byte[] { 0x00, 0x00, 0x3F, 0x41, 0x41, 0x41, 0x41, 0x00 },
new byte[] { 0x00, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00 },
new byte[] { 0x00, 0x00, 0x3F, 0x41, 0x41, 0x3F, 0x01, 0x01 },
new byte[] { 0x00, 0x00, 0x3E, 0x21, 0x21, 0x3E, 0x60, 0x20 },
new byte[] { 0x00, 0x00, 0x7E, 0x01, 0x01, 0x01, 0x01, 0x00 },
new byte[] { 0x00, 0x00, 0x3E, 0x01, 0x3E, 0x40, 0x3F, 0x00 },
new byte[] { 0x00, 0x04, 0x3F, 0x04, 0x04, 0x04, 0x78, 0x00 },
new byte[] { 0x00, 0x00, 0x41, 0x41, 0x41, 0x61, 0x5E, 0x00 },
new byte[] { 0x00, 0x00, 0x41, 0x41, 0x22, 0x14, 0x08, 0x00 },
new byte[] { 0x00, 0x00, 0x41, 0x41, 0x49, 0x49, 0x36, 0x00 },
new byte[] { 0x00, 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00 },
new byte[] { 0x00, 0x00, 0x41, 0x41, 0x41, 0x7E, 0x40, 0x3E },
new byte[] { 0x00, 0x00, 0x7F, 0x30, 0x0C, 0x03, 0x7F, 0x00 },
new byte[] { 0x30, 0x08, 0x08, 0x04, 0x08, 0x08, 0x30, 0x00 },
new byte[] { 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x00 },
new byte[] { 0x0C, 0x10, 0x10, 0x20, 0x10, 0x10, 0x0C, 0x00 },
new byte[] { 0x44, 0x2A, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00 },
new byte[] { 0x08, 0x14, 0x14, 0x22, 0x22, 0x22, 0x3E, 0x00 },
};
/// <inheritdoc/>
public override byte Width { get => 8; }
/// <inheritdoc/>
public override byte Height { get => 8; }
/// <inheritdoc/>
public override byte[] this[char character]
{
get
{
var index = (byte)character;
if ((index < 32) || (index > 127))
{
return _fontTable[32];
}
else
{
return _fontTable[index - 32];
}
}
}
}
}