Емельянов Эдуард Владимирович (eddy_em) wrote,
Емельянов Эдуард Владимирович
eddy_em

Простая утилита редактирования шрифтов для LCD

Для работы с экранчиком Nokia 5110 понадобился мне готовый шрифт. Однако, ничего толкового для КОИ8-Р я не нашел. Поэтому решено было из того, что есть, надергать готовых букв, а недостающие дорисовать.
Долгий поиск в сети ничего путного не дал: в основном либо что-то очень кривое, либо под мастдайку. Поэтому решено было накалякать на html+JS простую утилитку, которая позволяла бы щелкая мышкой рисовать буквы и получать соответствующий код, либо отображать букву по введенному коду (для проверки готовых букв).
Вот что получилось:
15.10.07_01:43:54
Внешний вид утилитки


А вот, собственно, код самой утилитки:
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
	<title>Символы</title>
	<style type="text/css">
		table, td, th {border: 2px solid black;}
		th {background-color: green; color: white;}
		td, th {height: 50px; width: 50px;}
		td.normal {background-color: white;}
		td.checked {background-color: black;}
	</style>
	<script>
		const xsz = 6, ysz = 8;
		function update_values(){
			var i,j, str = "";
			for(i = 0; i < xsz; ++i){
				var val = 0;
				for(j = ysz-1; j > -1; --j){
					var id = "x"+i+"y"+j;
					val <<= 1;
					if(document.getElementById(id).className == "checked") val |= 1;
				}
				str += "0x" + (val > 15 ? "" : "0") + val.toString(16) + ","
					+ (i == xsz-1 ? "" : " ");
			}
			var cb = document.getElementById("codeblk");
			cb.value = str;
			cb.select();
		}
		function update_table(){
			var strings = document.getElementById("codeblk").value.split(",");
			for(i = 0; i < xsz; ++i){
				var val = parseInt(strings[i], 16);
				for(j = ysz-1; j > -1; --j){
					var td = document.getElementById("x"+i+"y"+j)
					if(val & 1<<j)
						td.className = "checked";
					else
						td.className = "normal";
				}
			}
		}
		function swap_class(){
			if(this.className == "normal")
				this.className = "checked";
			else
				this.className = "normal";
			update_values();
		}
		function clear_all(){
			document.getElementById("codeblk").value = "";// "0x00, 0x00, 0x00, 0x00, 0x00, 0x00,";
			update_table();
		}
		function filltable(){
			var tbl = document.createElement("table");
			var i, j, tr = document.createElement("tr");
			tbl.appendChild(tr);
			for(i = -1; i < xsz; ++i){
				var th = document.createElement("th");
				if(i != -1) th.innerHTML = i;
				tr.appendChild(th);
			}
			for(j = 0; j < ysz; ++j){
				tr = document.createElement("tr");
				tbl.appendChild(tr);
				for(i = -1; i < xsz; ++i){
					var td;
					if(i != -1){
						td = document.createElement("td");
						td.className = "normal";
						td.addEventListener("click", swap_class);
						td.id = "x"+i+"y"+j;
					}else{
						td = document.createElement("th");
						td.innerHTML = j;
					}
					tr.appendChild(td);
				}
			}
			document.body.appendChild(tbl);
			document.getElementById("codeblk").addEventListener("change", update_table);
			document.getElementById("clear").addEventListener("click", clear_all);
			update_values();
		}
	</script>
</head>
<body onload="filltable()">
	<div><input type="text" size="40" id="codeblk"><input type="button" value="Clear" id="clear"></div>
</body>
</html>


Ну и сам шрифт:
/*
 * font.c - russian font
 *
 * Copyright 2015 Edward V. Emelianoff <eddy@sao.ru, edward.emelianoff@gmail.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.
 *
 * 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., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 */

const uint8_t rusfont [] = {
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// 32 [0x20] -
	0x00, 0x00, 0x5F, 0x00, 0x00, 0x00,// 33 [0x21] - !
	0x00, 0x07, 0x00, 0x07, 0x00, 0x00,// 34 [0x22] - "
	0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00,// 35 [0x23] - #
	0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00,// 36 [0x24] - $
	0x23, 0x13, 0x08, 0x64, 0x62, 0x00,// 37 [0x25] - %
	0x36, 0x49, 0x55, 0x22, 0x50, 0x00,// 38 [0x26] - &
	0x00, 0x05, 0x03, 0x00, 0x00, 0x00,// 39 [0x27] - '
	0x00, 0x1C, 0x22, 0x41, 0x00, 0x00,// 40 [0x28] - (
	0x00, 0x41, 0x22, 0x1C, 0x00, 0x00,// 41 [0x29] - )
	0x08, 0x2A, 0x1C, 0x2A, 0x08, 0x00,// 42 [0x2a] - *
	0x08, 0x08, 0x3E, 0x08, 0x08, 0x00,// 43 [0x2b] - +
	0x00, 0x50, 0x30, 0x00, 0x00, 0x00,// 44 [0x2c] - ,
	0x08, 0x08, 0x08, 0x08, 0x08, 0x00,// 45 [0x2d] - -
	0x00, 0x60, 0x60, 0x00, 0x00, 0x00,// 46 [0x2e] - .
	0x20, 0x10, 0x08, 0x04, 0x02, 0x00,// 47 [0x2f] - /
	0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00,// 48 [0x30] - 0
	0x00, 0x42, 0x7F, 0x40, 0x00, 0x00,// 49 [0x31] - 1
	0x42, 0x61, 0x51, 0x49, 0x46, 0x00,// 50 [0x32] - 2
	0x21, 0x41, 0x45, 0x4B, 0x31, 0x00,// 51 [0x33] - 3
	0x18, 0x14, 0x12, 0x7F, 0x10, 0x00,// 52 [0x34] - 4
	0x27, 0x45, 0x45, 0x45, 0x39, 0x00,// 53 [0x35] - 5
	0x3C, 0x4A, 0x49, 0x49, 0x30, 0x00,// 54 [0x36] - 6
	0x01, 0x71, 0x09, 0x05, 0x03, 0x00,// 55 [0x37] - 7
	0x36, 0x49, 0x49, 0x49, 0x36, 0x00,// 56 [0x38] - 8
	0x06, 0x49, 0x49, 0x29, 0x1E, 0x00,// 57 [0x39] - 9
	0x00, 0x36, 0x36, 0x00, 0x00, 0x00,// 58 [0x3a] - :
	0x00, 0x56, 0x36, 0x00, 0x00, 0x00,// 59 [0x3b] - ;
	0x00, 0x08, 0x14, 0x22, 0x41, 0x00,// 60 [0x3c] - <
	0x14, 0x14, 0x14, 0x14, 0x14, 0x00,// 61 [0x3d] - =
	0x41, 0x22, 0x14, 0x08, 0x00, 0x00,// 62 [0x3e] - >
	0x02, 0x01, 0x51, 0x09, 0x06, 0x00,// 63 [0x3f] - ?
	0x32, 0x49, 0x79, 0x41, 0x3E, 0x00,// 64 [0x40] - @
	0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00,// 65 [0x41] - A
	0x7F, 0x49, 0x49, 0x49, 0x36, 0x00,// 66 [0x42] - B
	0x3E, 0x41, 0x41, 0x41, 0x22, 0x00,// 67 [0x43] - C
	0x7F, 0x41, 0x41, 0x22, 0x1C, 0x00,// 68 [0x44] - D
	0x7F, 0x49, 0x49, 0x49, 0x41, 0x00,// 69 [0x45] - E
	0x7F, 0x09, 0x09, 0x01, 0x01, 0x00,// 70 [0x46] - F
	0x3E, 0x41, 0x41, 0x51, 0x32, 0x00,// 71 [0x47] - G
	0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00,// 72 [0x48] - H
	0x00, 0x41, 0x7F, 0x41, 0x00, 0x00,// 73 [0x49] - I
	0x20, 0x40, 0x41, 0x3F, 0x01, 0x00,// 74 [0x4a] - J
	0x7F, 0x08, 0x14, 0x22, 0x41, 0x00,// 75 [0x4b] - K
	0x7F, 0x40, 0x40, 0x40, 0x40, 0x00,// 76 [0x4c] - L
	0x7F, 0x02, 0x04, 0x02, 0x7F, 0x00,// 77 [0x4d] - M
	0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00,// 78 [0x4e] - N
	0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00,// 79 [0x4f] - O
	0x7F, 0x09, 0x09, 0x09, 0x06, 0x00,// 80 [0x50] - P
	0x3e, 0x41, 0x51, 0x21, 0xde, 0x00,// 81 [0x51] - Q
	0x7F, 0x09, 0x19, 0x29, 0x46, 0x00,// 82 [0x52] - R
	0x46, 0x49, 0x49, 0x49, 0x31, 0x00,// 83 [0x53] - S
	0x01, 0x01, 0x7F, 0x01, 0x01, 0x00,// 84 [0x54] - T
	0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00,// 85 [0x55] - U
	0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00,// 86 [0x56] - V
	0x7F, 0x20, 0x18, 0x20, 0x7F, 0x00,// 87 [0x57] - W
	0x63, 0x14, 0x08, 0x14, 0x63, 0x00,// 88 [0x58] - X
	0x03, 0x04, 0x78, 0x04, 0x03, 0x00,// 89 [0x59] - Y
	0x61, 0x51, 0x49, 0x45, 0x43, 0x00,// 90 [0x5a] - Z
	0x00, 0x00, 0x7F, 0x41, 0x41, 0x00,// 91 [0x5b] - [
	0x02, 0x04, 0x08, 0x10, 0x20, 0x00,// 92 [0x5c] - "\"
	0x41, 0x41, 0x7F, 0x00, 0x00, 0x00,// 93 [0x5d] - ]
	0x04, 0x02, 0x01, 0x02, 0x04, 0x00,// 94 [0x5e] - ^
	0x40, 0x40, 0x40, 0x40, 0x40, 0x00,// 95 [0x5f] - _
	0x00, 0x01, 0x02, 0x04, 0x00, 0x00,// 96 [0x60] - `
	0x20, 0x54, 0x54, 0x54, 0x78, 0x00,// 97 [0x61] - a
	0x7F, 0x48, 0x44, 0x44, 0x38, 0x00,// 98 [0x62] - b
	0x38, 0x44, 0x44, 0x44, 0x20, 0x00,// 99 [0x63] - c
	0x38, 0x44, 0x44, 0x48, 0x7F, 0x00,//100 [0x64] - d
	0x38, 0x54, 0x54, 0x54, 0x18, 0x00,//101 [0x65] - e
	0x00, 0x08, 0xfe, 0x09, 0x02, 0x00,//102 [0x66] - f
	0x18, 0xa4, 0xa4, 0x94, 0x78, 0x00,//103 [0x67] - g
	0x7F, 0x08, 0x04, 0x04, 0x78, 0x00,//104 [0x68] - h
	0x00, 0x44, 0x7D, 0x40, 0x00, 0x00,//105 [0x69] - i
	0x40, 0x80, 0x84, 0x7d, 0x00, 0x00,//106 [0x6a] - j
	0x00, 0x7F, 0x10, 0x28, 0x44, 0x00,//107 [0x6b] - k
	0x00, 0x41, 0x7F, 0x40, 0x00, 0x00,//108 [0x6c] - l
	0x7C, 0x04, 0x18, 0x04, 0x78, 0x00,//109 [0x6d] - m
	0x7C, 0x08, 0x04, 0x04, 0x78, 0x00,//110 [0x6e] - n
	0x38, 0x44, 0x44, 0x44, 0x38, 0x00,//111 [0x6f] - o
	0xfc, 0x28, 0x24, 0x24, 0x18, 0x00,//112 [0x70] - p
	0x18, 0x24, 0x24, 0x28, 0xfc, 0x00,//113 [0x71] - q
	0x7C, 0x08, 0x04, 0x04, 0x08, 0x00,//114 [0x72] - r
	0x48, 0x54, 0x54, 0x54, 0x20, 0x00,//115 [0x73] - s
	0x04, 0x3F, 0x44, 0x40, 0x20, 0x00,//116 [0x74] - t
	0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00,//117 [0x75] - u
	0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00,//118 [0x76] - v
	0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00,//119 [0x77] - w
	0x44, 0x28, 0x10, 0x28, 0x44, 0x00,//120 [0x78] - x
	0x0C, 0x50, 0x50, 0x50, 0x3C, 0x00,//121 [0x79] - y
	0x44, 0x64, 0x54, 0x4C, 0x44, 0x00,//122 [0x7a] - z
	0x00, 0x08, 0x36, 0x41, 0x00, 0x00,//123 [0x7b] - {
	0x00, 0x00, 0x7F, 0x00, 0x00, 0x00,//124 [0x7c] - |
	0x00, 0x41, 0x36, 0x08, 0x00, 0x00,//125 [0x7d] - }
	0x08, 0x04, 0x08, 0x10, 0x08, 0x00,//126 [0x7e] - ~
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//127 [0x7f] -
	0x08, 0x08, 0x08, 0x08, 0x08, 0x08,//128 [0x80] - ─
	0x00, 0x00, 0xff, 0x00, 0x00, 0x00,//129 [0x81] - │
	0x00, 0x00, 0xf8, 0x08, 0x08, 0x08,//130 [0x82] - ┌
	0x08, 0x08, 0xf8, 0x00, 0x00, 0x00,//131 [0x83] - ┐
	0x00, 0x00, 0x0f, 0x08, 0x08, 0x08,//132 [0x84] - └
	0x08, 0x08, 0x0f, 0x00, 0x00, 0x00,//133 [0x85] - ┘
	0x00, 0x00, 0xff, 0x08, 0x08, 0x08,//134 [0x86] - ├
	0x08, 0x08, 0xff, 0x00, 0x00, 0x00,//135 [0x87] - ┤
	0x08, 0x08, 0xf8, 0x08, 0x08, 0x08,//136 [0x88] - ┬
	0x08, 0x08, 0x0f, 0x08, 0x08, 0x08,//137 [0x89] - ┴
	0x08, 0x08, 0xff, 0x08, 0x08, 0x08,//138 [0x8a] - ┼
	0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,//139 [0x8b] - ▀
	0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,//140 [0x8c] - ▄
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff,//141 [0x8d] - █
	0xff, 0xff, 0xff, 0x00, 0x00, 0x00,//142 [0x8e] - ▌
	0x00, 0x00, 0x00, 0xff, 0xff, 0xff,//143 [0x8f] - ▐
	0x00, 0xaa, 0x00, 0x55, 0x00, 0xaa,//144 [0x90] - ░
	0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,//145 [0x91] - ▒
	0x55, 0xff, 0x55, 0xff, 0x55, 0xff,//146 [0x92] - ▓
	0x00, 0x00, 0xfc, 0x02, 0x04, 0x00,//147 [0x93] - ⌠
	0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c,//148 [0x94] - ■
	0x00, 0x00, 0x18, 0x18, 0x00, 0x00,//149 [0x95] - ∙
	0x08, 0x38, 0x40, 0x30, 0x0e, 0x01,//150 [0x96] - √
	0x24, 0x12, 0x24, 0x48, 0x24, 0x00,//151 [0x97] - ≈
	0x00, 0x44, 0x4a, 0x51, 0x00, 0x00,//152 [0x98] - ≤
	0x00, 0x51, 0x4a, 0x44, 0x00, 0x00,//153 [0x99] - ≥
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//154 [0x9a] -  
	0x20, 0x40, 0x3f, 0x00, 0x00, 0x00,//155 [0x9b] - ⌡
	0x00, 0x06, 0x09, 0x06, 0x00, 0x00,//156 [0x9c] - °
	0x00, 0x0d, 0x0b, 0x00, 0x00, 0x00,//157 [0x9d] - ²
	0x00, 0x00, 0x08, 0x00, 0x00, 0x00,//158 [0x9e] - ·
	0x08, 0x08, 0x2a, 0x08, 0x08, 0x00,//159 [0x9f] - ÷
	0x14, 0x14, 0x14, 0x14, 0x14, 0x14,//160 [0xa0] - ═
	0x00, 0xff, 0x00, 0xff, 0x00, 0x00,//161 [0xa1] - ║
	0x00, 0x00, 0xfc, 0x14, 0x14, 0x14,//162 [0xa2] - ╒
	0x38, 0x55, 0x54, 0x55, 0x18, 0x00,//163 [0xa3] - ё
	0x00, 0xf8, 0x08, 0xf8, 0x08, 0x08,//164 [0xa4] - ╓
	0x00, 0xfc, 0x04, 0xf4, 0x14, 0x14,//165 [0xa5] - ╔
	0x14, 0x14, 0xfc, 0x00, 0x00, 0x00,//166 [0xa6] - ╕
	0x08, 0xf8, 0x08, 0xf8, 0x00, 0x00,//167 [0xa7] - ╖
	0x14, 0xf4, 0x04, 0xfc, 0x00, 0x00,//168 [0xa8] - ╗
	0x00, 0x00, 0x1f, 0x14, 0x14, 0x14,//169 [0xa9] - ╘
	0x00, 0x0f, 0x08, 0x0f, 0x08, 0x08,//170 [0xaa] - ╙
	0x00, 0x1f, 0x10, 0x17, 0x14, 0x14,//171 [0xab] - ╚
	0x14, 0x14, 0x1f, 0x00, 0x00, 0x00,//172 [0xac] - ╛
	0x08, 0x0f, 0x08, 0x0f, 0x00, 0x00,//173 [0xad] - ╜
	0x14, 0x17, 0x10, 0x1f, 0x00, 0x00,//174 [0xae] - ╝
	0x00, 0x00, 0xff, 0x14, 0x14, 0x14,//175 [0xaf] - ╞
	0x00, 0xff, 0x00, 0xff, 0x08, 0x08,//176 [0xb0] - ╟
	0x00, 0xff, 0x00, 0xf7, 0x14, 0x14,//177 [0xb1] - ╠
	0x14, 0x14, 0xff, 0x00, 0x00, 0x00,//178 [0xb2] - ╡
	0x7e, 0x4b, 0x4a, 0x43, 0x42, 0x00,//179 [0xb3] - Ё
	0x08, 0xff, 0x00, 0xff, 0x00, 0x00,//180 [0xb4] - ╢
	0x14, 0xf7, 0x00, 0xff, 0x00, 0x00,//181 [0xb5] - ╣
	0x14, 0x14, 0xf4, 0x14, 0x14, 0x14,//182 [0xb6] - ╤
	0x08, 0xf8, 0x08, 0xf8, 0x08, 0x08,//183 [0xb7] - ╥
	0x14, 0xf4, 0x04, 0xf4, 0x14, 0x14,//184 [0xb8] - ╦
	0x14, 0x14, 0x17, 0x14, 0x14, 0x14,//185 [0xb9] - ╧
	0x08, 0x0f, 0x08, 0x0f, 0x08, 0x08,//186 [0xba] - ╨
	0x14, 0x17, 0x14, 0x17, 0x14, 0x14,//187 [0xbb] - ╩
	0x14, 0x14, 0xff, 0x14, 0x14, 0x14,//188 [0xbc] - ╪
	0x08, 0xff, 0x08, 0xff, 0x08, 0x08,//189 [0xbd] - ╫
	0x14, 0xf7, 0x00, 0xf7, 0x14, 0x14,//190 [0xbe] - ╬
	0x3e, 0x5d, 0x55, 0x41, 0x3e, 0x00,//191 [0xbf] - ©
	0x7c, 0x10, 0x38, 0x44, 0x38, 0x00,//192 [0xc0] - ю
	0x20, 0x54, 0x54, 0x54, 0x78, 0x00,//193 [0xc1] - а
	0x3c, 0x4a, 0x4a, 0x49, 0x31, 0x00,//194 [0xc2] - б
	0x7c, 0x40, 0x40, 0x40, 0xfc, 0x00,//195 [0xc3] - ц
	0xe0, 0x54, 0x4c, 0x44, 0xfc, 0x00,//196 [0xc4] - д
	0x38, 0x54, 0x54, 0x54, 0x18, 0x00,//197 [0xc5] - е
	0x30, 0x48, 0xfc, 0x48, 0x30, 0x00,//198 [0xc6] - ф
	0x7c, 0x04, 0x04, 0x04, 0x0c, 0x00,//199 [0xc7] - г
	0x44, 0x28, 0x10, 0x28, 0x44, 0x00,//200 [0xc8] - х
	0x7c, 0x20, 0x10, 0x08, 0x7c, 0x00,//201 [0xc9] - и
	0x7c, 0x41, 0x22, 0x11, 0x7c, 0x00,//202 [0xca] - й
	0x7c, 0x10, 0x28, 0x44, 0x00, 0x00,//203 [0xcb] - к
	0x20, 0x44, 0x3c, 0x04, 0x7c, 0x00,//204 [0xcc] - л
	0x7c, 0x08, 0x10, 0x08, 0x7c, 0x00,//205 [0xcd] - м
	0x7c, 0x10, 0x10, 0x10, 0x7c, 0x00,//206 [0xce] - н
	0x38, 0x44, 0x44, 0x44, 0x38, 0x00,//207 [0xcf] - о
	0x7c, 0x04, 0x04, 0x04, 0x7c, 0x00,//208 [0xd0] - п
	0x08, 0x54, 0x34, 0x14, 0x7c, 0x00,//209 [0xd1] - я
	0x7C, 0x14, 0x14, 0x14, 0x08, 0x00,//210 [0xd2] - р
	0x38, 0x44, 0x44, 0x44, 0x20, 0x00,//211 [0xd3] - с
	0x04, 0x04, 0x7c, 0x04, 0x04, 0x00,//212 [0xd4] - т
	0x0C, 0x50, 0x50, 0x50, 0x3C, 0x00,//213 [0xd5] - у
	0x6c, 0x10, 0x7c, 0x10, 0x6c, 0x00,//214 [0xd6] - ж
	0x7c, 0x54, 0x54, 0x28, 0x00, 0x00,//215 [0xd7] - в
	0x7c, 0x50, 0x50, 0x20, 0x00, 0x00,//216 [0xd8] - ь
	0x7c, 0x50, 0x50, 0x20, 0x7c, 0x00,//217 [0xd9] - ы
	0x44, 0x44, 0x54, 0x54, 0x28, 0x00,//218 [0xda] - з
	0x7c, 0x40, 0x7c, 0x40, 0x7c, 0x00,//219 [0xdb] - ш
	0x28, 0x44, 0x54, 0x54, 0x38, 0x00,//220 [0xdc] - э
	0x7c, 0x40, 0x7c, 0x40, 0xfc, 0x00,//221 [0xdd] - щ
	0x0c, 0x10, 0x10, 0x10, 0x7c, 0x00,//222 [0xde] - ч
	0x04, 0x7c, 0x50, 0x50, 0x20, 0x00,//223 [0xdf] - ъ
	0x7f, 0x08, 0x3e, 0x41, 0x3e, 0x00,//224 [0xe0] - Ю
	0x7e, 0x11, 0x11, 0x11, 0x7e, 0x00,//225 [0xe1] - А
	0x7f, 0x49, 0x49, 0x49, 0x33, 0x00,//226 [0xe2] - Б
	0x7f, 0x40, 0x40, 0x40, 0xff, 0x00,//227 [0xe3] - Ц
	0xe0, 0x51, 0x4f, 0x41, 0xff, 0x00,//228 [0xe4] - Д
	0x7f, 0x49, 0x49, 0x49, 0x41, 0x00,//229 [0xe5] - Е
	0x1c, 0x22, 0x7f, 0x22, 0x1c, 0x00,//230 [0xe6] - Ф
	0x7f, 0x01, 0x01, 0x01, 0x03, 0x00,//231 [0xe7] - Г
	0x63, 0x14, 0x08, 0x14, 0x63, 0x00,//232 [0xe8] - Х
	0x7f, 0x10, 0x08, 0x04, 0x7f, 0x00,//233 [0xe9] - И
	0x7c, 0x21, 0x12, 0x09, 0x7c, 0x00,//234 [0xea] - Й
	0x7f, 0x08, 0x14, 0x22, 0x41, 0x00,//235 [0xeb] - К
	0x20, 0x41, 0x3f, 0x01, 0x7f, 0x00,//236 [0xec] - Л
	0x7f, 0x02, 0x0c, 0x02, 0x7f, 0x00,//237 [0xed] - М
	0x7f, 0x08, 0x08, 0x08, 0x7f, 0x00,//238 [0xee] - Н
	0x3e, 0x41, 0x41, 0x41, 0x3e, 0x00,//239 [0xef] - О
	0x7f, 0x01, 0x01, 0x01, 0x7f, 0x00,//240 [0xf0] - П
	0x46, 0x29, 0x19, 0x09, 0x7f, 0x00,//241 [0xf1] - Я
	0x7f, 0x09, 0x09, 0x09, 0x06, 0x00,//242 [0xf2] - Р
	0x3e, 0x41, 0x41, 0x41, 0x22, 0x00,//243 [0xf3] - С
	0x01, 0x01, 0x7f, 0x01, 0x01, 0x00,//244 [0xf4] - Т
	0x47, 0x28, 0x10, 0x08, 0x07, 0x00,//245 [0xf5] - У
	0x77, 0x08, 0x7f, 0x08, 0x77, 0x00,//246 [0xf6] - Ж
	0x7f, 0x49, 0x49, 0x49, 0x36, 0x00,//247 [0xf7] - В
	0x22, 0x41, 0x49, 0x49, 0x3e, 0x00,//248 [0xf8] - Ь
	0x7f, 0x48, 0x30, 0x00, 0x7f, 0x00,//249 [0xf9] - Ы
	0x41, 0x49, 0x49, 0x49, 0x36, 0x00,//250 [0xfa] - З
	0x7f, 0x40, 0x7f, 0x40, 0x7f, 0x00,//251 [0xfb] - Ш
	0x00, 0x7f, 0x48, 0x48, 0x30, 0x00,//252 [0xfc] - Э
	0x7f, 0x40, 0x7f, 0x40, 0xff, 0x00,//253 [0xfd] - Щ
	0x07, 0x08, 0x08, 0x08, 0x7f, 0x00,//254 [0xfe] - Ч
	0x01, 0x7f, 0x48, 0x48, 0x30, 0x00,//255 [0xff] - Ъ
};

/**
 * Return letter array
 */
uint8_t *letter(uint8_t koi8){
	int idx = (koi8 - 32)*6;
	return &rusfont[idx];
}

#endif // __FONT_H__

Для символов псевдографики пришлось явно рисовать полное знакоместо, поэтому в буквах каждый последний байт — нули.
Tags: всячина
Subscribe

  • M$ teams…

    Начал с сегодняшнего дня студентам ЮФУ удаленно лекции читать. У них все завязано на различные корпорации зла. И базовая работа - через teams. ОК,…

  • Почему systemd — дерьмо

    Уже давно на эту статейку натыкался, но все забывал в "закладки" добавить. Вот, добавляю: "systemd — отстой". Советую эту статейку почитать…

  • Что-то китайцы вообще веб-морду али поломали!

    Если раньше проблема была только в назойливом "квазирусском" интерфейсе, который постоянно приходилось отключать, то сейчас еще больше багов…

promo eddy_em september 3, 12:13 8
Buy for 10 tokens
Уже больше полугода занимаюсь разработкой, вот, наконец-то в мастерских взялись за меня и начали выдавать первые детали. Сегодня сделал тестовую сборку (как обычно, местами пришлось "доработать напильником"): Пока прибор без названия (да и как-то не лезет в голову ничего, у меня нет…
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic
  • 6 comments