├── leon └── 7x10 │ ├── Settings │ ├── U+0020 │ ├── U+0021 │ ├── U+0022 │ ├── U+0023 │ ├── U+0024 │ ├── U+0025 │ ├── U+0026 │ ├── U+0027 │ ├── U+0028 │ ├── U+0029 │ ├── U+002A │ ├── U+002B │ ├── U+002C │ ├── U+002D │ ├── U+002E │ ├── U+002F │ ├── U+0030 │ ├── U+0031 │ ├── U+0032 │ ├── U+0033 │ ├── U+0034 │ ├── U+0035 │ ├── U+0036 │ ├── U+0037 │ ├── U+0038 │ ├── U+0039 │ ├── U+003A │ ├── U+003B │ ├── U+003C │ ├── U+003D │ ├── U+003E │ ├── U+003F │ ├── U+0040 │ ├── U+0041 │ ├── U+0042 │ ├── U+0043 │ ├── U+0044 │ ├── U+0045 │ ├── U+0046 │ ├── U+0047 │ ├── U+0048 │ ├── U+0049 │ ├── U+004A │ ├── U+004B │ ├── U+004C │ ├── U+004D │ ├── U+004E │ ├── U+004F │ ├── U+0050 │ ├── U+0051 │ ├── U+0052 │ ├── U+0053 │ ├── U+0054 │ ├── U+0055 │ ├── U+0056 │ ├── U+0057 │ ├── U+0058 │ ├── U+0059 │ ├── U+005A │ ├── U+005B │ ├── U+005C │ ├── U+005D │ ├── U+005E │ ├── U+005F │ ├── U+0060 │ ├── U+0061 │ ├── U+0062 │ ├── U+0063 │ ├── U+0064 │ ├── U+0065 │ ├── U+0066 │ ├── U+0067 │ ├── U+0068 │ ├── U+0069 │ ├── U+006A │ ├── U+006B │ ├── U+006C │ ├── U+006D │ ├── U+006E │ ├── U+006F │ ├── U+0070 │ ├── U+0071 │ ├── U+0072 │ ├── U+0073 │ ├── U+0074 │ ├── U+0075 │ ├── U+0076 │ ├── U+0077 │ ├── U+0078 │ ├── U+0079 │ ├── U+007A │ ├── U+007B │ ├── U+007C │ ├── U+007D │ ├── U+007E │ ├── U+00A9 │ └── U+2022 ├── src ├── .gitignore ├── Makefile ├── watch.sh ├── LICENSE ├── 2bdf.sh ├── edit.c └── view.c ├── test └── gen └── README /leon/7x10/Settings: -------------------------------------------------------------------------------- 1 | NAME="leon" 2 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | edit 2 | view 3 | .comfile 4 | -------------------------------------------------------------------------------- /leon/7x10/U+0020: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ....... 5 | ....... 6 | ....... 7 | ....... 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0021: -------------------------------------------------------------------------------- 1 | ....... 2 | ..x.... 3 | ..x.... 4 | ..x.... 5 | ..x.... 6 | ..x.... 7 | ....... 8 | ..x.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0022: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | .x.x... 4 | .x.x... 5 | .x.x... 6 | ....... 7 | ....... 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0023: -------------------------------------------------------------------------------- 1 | ....... 2 | .x.x... 3 | .x.x... 4 | xxxxx.. 5 | .x.x... 6 | .x.x... 7 | xxxxx.. 8 | .x.x... 9 | .x.x... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0024: -------------------------------------------------------------------------------- 1 | ....... 2 | ..x.... 3 | .xxx... 4 | x.x.x.. 5 | x.x.... 6 | .xxx... 7 | ..x.x.. 8 | x.x.x.. 9 | .xxx... 10 | ..x.... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0025: -------------------------------------------------------------------------------- 1 | ....... 2 | xx..x.. 3 | xx..x.. 4 | ...x... 5 | ..x.... 6 | .x..... 7 | x..xx.. 8 | x..xx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0026: -------------------------------------------------------------------------------- 1 | ....... 2 | .x..... 3 | x.x.... 4 | x.x.... 5 | .x..... 6 | x.x.x.. 7 | x..x... 8 | .xx.x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0027: -------------------------------------------------------------------------------- 1 | ....... 2 | ..x.... 3 | ..x.... 4 | ..x.... 5 | ....... 6 | ....... 7 | ....... 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0028: -------------------------------------------------------------------------------- 1 | ....... 2 | ...x... 3 | ..x.... 4 | .x..... 5 | .x..... 6 | .x..... 7 | .x..... 8 | .x..... 9 | ..x.... 10 | ...x... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0029: -------------------------------------------------------------------------------- 1 | ....... 2 | .x..... 3 | ..x.... 4 | ...x... 5 | ...x... 6 | ...x... 7 | ...x... 8 | ...x... 9 | ..x.... 10 | .x..... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+002A: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | x.x.x.. 5 | .xxx... 6 | ..x.... 7 | .xxx... 8 | x.x.x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+002B: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ..x.... 5 | ..x.... 6 | xxxxx.. 7 | ..x.... 8 | ..x.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+002C: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ....... 5 | ....... 6 | ....... 7 | .xx.... 8 | .xx.... 9 | ..x.... 10 | .x..... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+002D: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ....... 5 | ....... 6 | xxxxx.. 7 | ....... 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+002E: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ....... 5 | ....... 6 | ....... 7 | .xx.... 8 | .xx.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+002F: -------------------------------------------------------------------------------- 1 | ....... 2 | ....x.. 3 | ....x.. 4 | ...x... 5 | ...x... 6 | ..x.... 7 | ..x.... 8 | .x..... 9 | .x..... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0030: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | x..xx.. 5 | x.x.x.. 6 | xx..x.. 7 | x...x.. 8 | .xxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0031: -------------------------------------------------------------------------------- 1 | ....... 2 | ..x.... 3 | .xx.... 4 | x.x.... 5 | ..x.... 6 | ..x.... 7 | ..x.... 8 | xxxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0032: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | ....x.. 5 | ..xx... 6 | .x..... 7 | x...... 8 | xxxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0033: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | ....x.. 5 | ..xx... 6 | ....x.. 7 | x...x.. 8 | .xxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0034: -------------------------------------------------------------------------------- 1 | ....... 2 | ..x.... 3 | ..x.... 4 | .x..... 5 | .x.x... 6 | x..x... 7 | xxxxx.. 8 | ...x... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0035: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxxx.. 3 | x...... 4 | x...... 5 | xxxx... 6 | ....x.. 7 | ....x.. 8 | xxxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0036: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...... 4 | x...... 5 | xxxx... 6 | x...x.. 7 | x...x.. 8 | .xxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0037: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxxx.. 3 | ....x.. 4 | ....x.. 5 | ...x... 6 | ..x.... 7 | .x..... 8 | .x..... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0038: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | x...x.. 5 | .xxx... 6 | x...x.. 7 | x...x.. 8 | .xxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0039: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | x...x.. 5 | .xxxx.. 6 | ....x.. 7 | ....x.. 8 | .xxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+003A: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | .xx.... 5 | .xx.... 6 | ....... 7 | .xx.... 8 | .xx.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+003B: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | .xx.... 5 | .xx.... 6 | ....... 7 | .xx.... 8 | .xx.... 9 | ..x.... 10 | .x..... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+003C: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ..x.... 5 | .x..... 6 | x...... 7 | .x..... 8 | ..x.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+003D: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ....... 5 | xxxxx.. 6 | ....... 7 | xxxxx.. 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+003E: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ..x.... 5 | ...x... 6 | ....x.. 7 | ...x... 8 | ..x.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+003F: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | ....x.. 5 | ...x... 6 | ..x.... 7 | ....... 8 | ..x.... 9 | ..x.... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0040: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | x.xxx.. 5 | x.x.x.. 6 | x.xxx.. 7 | x...... 8 | .xxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0041: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | x...x.. 5 | xxxxx.. 6 | x...x.. 7 | x...x.. 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0042: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxx... 3 | x...x.. 4 | x...x.. 5 | xxxx... 6 | x...x.. 7 | x...x.. 8 | xxxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0043: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxxx.. 3 | x...... 4 | x...... 5 | x...... 6 | x...... 7 | x...... 8 | .xxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0044: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxx... 3 | x...x.. 4 | x...x.. 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | xxxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0045: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxxx.. 3 | x...... 4 | x...... 5 | xxx.... 6 | x...... 7 | x...... 8 | xxxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0046: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxxx.. 3 | x...... 4 | x...... 5 | xxx.... 6 | x...... 7 | x...... 8 | x...... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0047: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxxx.. 3 | x...... 4 | x...... 5 | x..xx.. 6 | x...x.. 7 | x...x.. 8 | .xxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0048: -------------------------------------------------------------------------------- 1 | ....... 2 | x...x.. 3 | x...x.. 4 | x...x.. 5 | xxxxx.. 6 | x...x.. 7 | x...x.. 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0049: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | ..x.... 4 | ..x.... 5 | ..x.... 6 | ..x.... 7 | ..x.... 8 | .xxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+004A: -------------------------------------------------------------------------------- 1 | ....... 2 | ..xxx.. 3 | ....x.. 4 | ....x.. 5 | ....x.. 6 | ....x.. 7 | ....x.. 8 | xxxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+004B: -------------------------------------------------------------------------------- 1 | ....... 2 | x...x.. 3 | x..x... 4 | x.x.... 5 | xx..... 6 | x.x.... 7 | x..x... 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+004C: -------------------------------------------------------------------------------- 1 | ....... 2 | x...... 3 | x...... 4 | x...... 5 | x...... 6 | x...... 7 | x...... 8 | xxxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+004D: -------------------------------------------------------------------------------- 1 | ....... 2 | x...x.. 3 | xx.xx.. 4 | x.x.x.. 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+004E: -------------------------------------------------------------------------------- 1 | ....... 2 | x...x.. 3 | xx..x.. 4 | x.x.x.. 5 | x.x.x.. 6 | x..xx.. 7 | x...x.. 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+004F: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | x...x.. 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | .xxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0050: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxx... 3 | x...x.. 4 | x...x.. 5 | xxxx... 6 | x...... 7 | x...... 8 | x...... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0051: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | x...x.. 4 | x...x.. 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | .xxx... 9 | ..x.... 10 | ...x... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0052: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxx... 3 | x...x.. 4 | x...x.. 5 | xxxx... 6 | x.x.... 7 | x..x... 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0053: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxxx.. 3 | x...... 4 | x...... 5 | .xxx... 6 | ....x.. 7 | ....x.. 8 | xxxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0054: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxxx.. 3 | ..x.... 4 | ..x.... 5 | ..x.... 6 | ..x.... 7 | ..x.... 8 | ..x.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0055: -------------------------------------------------------------------------------- 1 | ....... 2 | x...x.. 3 | x...x.. 4 | x...x.. 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | .xxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0056: -------------------------------------------------------------------------------- 1 | ....... 2 | x...x.. 3 | x...x.. 4 | x...x.. 5 | .x.x... 6 | .x.x... 7 | ..x.... 8 | ..x.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0057: -------------------------------------------------------------------------------- 1 | ....... 2 | x...x.. 3 | x...x.. 4 | x...x.. 5 | x...x.. 6 | x.x.x.. 7 | xx.xx.. 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0058: -------------------------------------------------------------------------------- 1 | ....... 2 | x...x.. 3 | x...x.. 4 | .x.x... 5 | ..x.... 6 | .x.x... 7 | x...x.. 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0059: -------------------------------------------------------------------------------- 1 | ....... 2 | x...x.. 3 | x...x.. 4 | .x.x... 5 | ..x.... 6 | ..x.... 7 | ..x.... 8 | ..x.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+005A: -------------------------------------------------------------------------------- 1 | ....... 2 | xxxxx.. 3 | ....x.. 4 | ...x... 5 | ..x.... 6 | .x..... 7 | x...... 8 | xxxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+005B: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | .x..... 4 | .x..... 5 | .x..... 6 | .x..... 7 | .x..... 8 | .x..... 9 | .x..... 10 | .xxx... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+005C: -------------------------------------------------------------------------------- 1 | ....... 2 | .x..... 3 | .x..... 4 | ..x.... 5 | ..x.... 6 | ...x... 7 | ...x... 8 | ....x.. 9 | ....x.. 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+005D: -------------------------------------------------------------------------------- 1 | ....... 2 | .xxx... 3 | ...x... 4 | ...x... 5 | ...x... 6 | ...x... 7 | ...x... 8 | ...x... 9 | ...x... 10 | .xxx... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+005E: -------------------------------------------------------------------------------- 1 | ....... 2 | ..x.... 3 | .x.x... 4 | x...x.. 5 | ....... 6 | ....... 7 | ....... 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+005F: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ....... 5 | ....... 6 | ....... 7 | ....... 8 | ....... 9 | xxxxx.. 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0060: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | .x..... 4 | ..x.... 5 | ....... 6 | ....... 7 | ....... 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0061: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | .xxxx.. 5 | x...x.. 6 | x...x.. 7 | x..xx.. 8 | .xx.x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0062: -------------------------------------------------------------------------------- 1 | ....... 2 | x...... 3 | x...... 4 | xxxx... 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | xxxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0063: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | .xxxx.. 5 | x...... 6 | x...... 7 | x...... 8 | .xxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0064: -------------------------------------------------------------------------------- 1 | ....... 2 | ....x.. 3 | ....x.. 4 | .xxxx.. 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | .xxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0065: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | .xxx... 5 | x...x.. 6 | xxxxx.. 7 | x...... 8 | .xxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0066: -------------------------------------------------------------------------------- 1 | ....... 2 | ..xx... 3 | .x..x.. 4 | .x..... 5 | xxxx... 6 | .x..... 7 | .x..... 8 | .x..... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0067: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | .xxxx.. 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | .xxxx.. 9 | ....x.. 10 | xxxx... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0068: -------------------------------------------------------------------------------- 1 | ....... 2 | x...... 3 | x...... 4 | x.xx... 5 | xx..x.. 6 | x...x.. 7 | x...x.. 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0069: -------------------------------------------------------------------------------- 1 | ....... 2 | ..x.... 3 | ....... 4 | .xx.... 5 | ..x.... 6 | ..x.... 7 | ..x.... 8 | ...xx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+006A: -------------------------------------------------------------------------------- 1 | ....... 2 | ...x... 3 | ....... 4 | ..xx... 5 | ...x... 6 | ...x... 7 | ...x... 8 | ...x... 9 | ...x... 10 | .xx.... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+006B: -------------------------------------------------------------------------------- 1 | ....... 2 | x...... 3 | x...... 4 | x..x... 5 | x.x.... 6 | xxx.... 7 | x..x... 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+006C: -------------------------------------------------------------------------------- 1 | ....... 2 | .xx.... 3 | ..x.... 4 | ..x.... 5 | ..x.... 6 | ..x.... 7 | ..x.... 8 | ...xx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+006D: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | xx.x... 5 | x.x.x.. 6 | x.x.x.. 7 | x.x.x.. 8 | x.x.x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+006E: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | x.xx... 5 | xx..x.. 6 | x...x.. 7 | x...x.. 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+006F: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | .xxx... 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | .xxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0070: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | xxxx... 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | xxxx... 9 | x...... 10 | x...... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0071: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | .xxxx.. 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | .xxxx.. 9 | ....x.. 10 | ....x.. 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0072: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | x.xx... 5 | xx..x.. 6 | x...... 7 | x...... 8 | x...... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0073: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | .xxx... 5 | x...... 6 | .xxx... 7 | ....x.. 8 | xxxx... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0074: -------------------------------------------------------------------------------- 1 | ....... 2 | .x..... 3 | .x..... 4 | xxxx... 5 | .x..... 6 | .x..... 7 | .x..... 8 | ..xxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0075: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | x...x.. 5 | x...x.. 6 | x...x.. 7 | x..xx.. 8 | .xx.x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0076: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | x...x.. 5 | x...x.. 6 | .x.x... 7 | .x.x... 8 | ..x.... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0077: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | x...x.. 5 | x.x.x.. 6 | x.x.x.. 7 | x.x.x.. 8 | .x.x... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0078: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | x...x.. 5 | .x.x... 6 | ..x.... 7 | .x.x... 8 | x...x.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+0079: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | x...x.. 5 | x...x.. 6 | x...x.. 7 | x...x.. 8 | .xxxx.. 9 | ....x.. 10 | xxxx... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+007A: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | xxxxx.. 5 | ...x... 6 | ..x.... 7 | .x..... 8 | xxxxx.. 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+007B: -------------------------------------------------------------------------------- 1 | ....... 2 | ...xx.. 3 | ..x.... 4 | ..x.... 5 | ..x.... 6 | .x..... 7 | ..x.... 8 | ..x.... 9 | ..x.... 10 | ...xx.. 11 | -------------------------------------------------------------------------------- /leon/7x10/U+007C: -------------------------------------------------------------------------------- 1 | ....... 2 | ..x.... 3 | ..x.... 4 | ..x.... 5 | ..x.... 6 | ..x.... 7 | ..x.... 8 | ..x.... 9 | ..x.... 10 | ..x.... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+007D: -------------------------------------------------------------------------------- 1 | ....... 2 | xx..... 3 | ..x.... 4 | ..x.... 5 | ..x.... 6 | ...x... 7 | ..x.... 8 | ..x.... 9 | ..x.... 10 | xx..... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+007E: -------------------------------------------------------------------------------- 1 | ....... 2 | .x..... 3 | x.x.x.. 4 | ...x... 5 | ....... 6 | ....... 7 | ....... 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+00A9: -------------------------------------------------------------------------------- 1 | ..xx... 2 | .x..x.. 3 | x.xx.x. 4 | x.x..x. 5 | x.xx.x. 6 | .x..x.. 7 | ..xx... 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /leon/7x10/U+2022: -------------------------------------------------------------------------------- 1 | ....... 2 | ....... 3 | ....... 4 | ..xx... 5 | .xxxx.. 6 | .xxxx.. 7 | ..xx... 8 | ....... 9 | ....... 10 | ....... 11 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS += -Wall 2 | 3 | all: edit view 4 | 5 | clean: 6 | rm -f edit view 7 | 8 | edit: edit.c 9 | $(CC) $(CFLAGS) -lncurses -o $@ $^ 10 | 11 | view: view.c 12 | $(CC) $(CFLAGS) -lX11 -o $@ $^ 13 | 14 | .PHONY: all clean 15 | -------------------------------------------------------------------------------- /src/watch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # See LICENSE for legal matters. 3 | 4 | set -e 5 | 6 | if test -z $1 7 | then 8 | echo "usage: watch.sh FONTPATH" 1>&2 9 | exit 1 10 | fi 11 | 12 | echo "[+] Watching $1" 13 | 14 | while inotifywait -qr -o /dev/null -e modify "$1" 15 | do 16 | echo " reload ..." 17 | killall -HUP view 2>/dev/null 18 | done 19 | -------------------------------------------------------------------------------- /test/gen: -------------------------------------------------------------------------------- 1 | 0123456789 2 | abcdefghijklmnopqrstuvwxyz 3 | the quick brown fox jumps over the lazy dog 4 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 5 | THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 6 | #include 7 | *(*p++)(x+&y-z); c[2] d{3} 8 | "abc"; 9 | 'def'; 10 | `ghi`; 11 | !@#$%^&* x:x; <+=-> ?:;., x^y d_b 12 | <[({(|)})]> 13 | /etc/passwd \/ /\ 14 | ls ~user|grep xx 15 | -------------------------------------------------------------------------------- /src/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright © 2015-2016 Quentin Carbonneaux 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or 10 | sell copies of the Software, and to permit persons to whom 11 | the Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 18 | KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 19 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 20 | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /src/2bdf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # See LICENSE for legal matters. 3 | 4 | # Your font directory may contain a Settings 5 | # file that can override all the defaults 6 | # below. 7 | 8 | set -e 9 | 10 | if test -z $1 11 | then 12 | echo "usage: 2bdf.sh FONTDIR" 1>&2 13 | exit 1 14 | fi 15 | 16 | FONT=$1 17 | 18 | FOUNDRY="mpu" # Foundry name 19 | NAME="yourfont" # Font name 20 | WEIGHT="medium" # bold, demibold, medium, or regular 21 | SLANT="r" # i, o, or r 22 | SETWIDTH="normal" # normal, or semicondensed 23 | SPACING="c" # c, m or p 24 | BASELINE=2 # y position of the baseline 25 | 26 | test -e $FONT/Settings && . $FONT/Settings 27 | 28 | D=${FONT##*/} 29 | W=${D%x*} 30 | H=${D#*x} 31 | 32 | cat << EOI 33 | STARTFONT 2.1 34 | FONT -$FOUNDRY-$NAME-$WEIGHT-$SLANT-$SETWIDTH--$H-$(($H * 10))-75-75-$SPACING-$(($W * 10))-iso10646-1 35 | SIZE $(((74 + H * 72) / 75)) 75 75 36 | FONTBOUNDINGBOX $W $H 0 -$BASELINE 37 | 38 | STARTPROPERTIES 18 39 | FONTNAME_REGISTRY "" 40 | FOUNDRY "$FOUNDRY" 41 | FAMILY_NAME "$NAME" 42 | WEIGHT_NAME "$WEIGHT" 43 | SLANT "$SLANT" 44 | SETWIDTH_NAME "$SETWIDTH" 45 | ADD_STYLE_NAME "" 46 | PIXEL_SIZE $H 47 | POINT_SIZE $(($H * 10)) 48 | RESOLUTION_X 75 49 | RESOLUTION_Y 75 50 | SPACING "$SPACING" 51 | AVERAGE_WIDTH $(($W * 10)) 52 | CHARSET_REGISTRY "ISO10646" 53 | CHARSET_ENCODING "1" 54 | DESTINATION 1 55 | FONT_ASCENT $(($H - $BASELINE)) 56 | FONT_DESCENT $BASELINE 57 | ENDPROPERTIES 58 | 59 | CHARS $(ls $FONT | grep "^U\\+" | wc -l) 60 | EOI 61 | 62 | for G in $FONT/U+* 63 | do 64 | CODE=$(printf "%d" "0x${G#*U+}") 65 | echo STARTCHAR $(basename $G) 66 | echo ENCODING $CODE 67 | echo SWIDTH 960 0 68 | echo DWIDTH $W 0 69 | echo BBX $W $H 0 -$BASELINE 70 | echo BITMAP 71 | 72 | awk " 73 | { 74 | hex = 0; 75 | split(\$0, chars, \"\") 76 | for (i=1; i<=8; i++) 77 | if (chars[i] == \"x\") 78 | hex = hex * 2 + 1; 79 | else 80 | hex = hex * 2; 81 | printf \"%02X\\n\", hex 82 | } 83 | " $G 84 | 85 | echo ENDCHAR 86 | done 87 | 88 | echo ENDFONT 89 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Bitmap Font Edition Tools 2 | ------------------------- 3 | 4 | Hi folks, 5 | 6 | I wrote some tools to design bitmap fonts! 7 | 8 | Two C programs, 'edit' and 'view', allow respectively to 9 | edit one glyph and view a text with the font currently 10 | being designed. The 'view' tool can get bitten by SIGHUP 11 | signals to refresh the view. To do this automatically 12 | when the font gets changed, I made a little shell script 13 | that uses inotify-tools to monitor the font directory 14 | energy-efficiently, it is 'watch.sh'. When done editing 15 | use the '2bdf.sh' shell script to convert the font to 16 | BDF (usable by X11). It does not work for fonts wider 17 | than 8 pixels, though, so you might have to patch it. 18 | 19 | The font format is I think suckless, a font is simply 20 | stored in a directory named WxH where W and H are the 21 | pixel dimensions of the font. Each glyph is then 22 | stored as an ASCII file named U+NNNN where NNNN is the 23 | Unicode codepoint of the glyph. Here is what is stored 24 | in 7x10/U+0041 (glyph 'A') for the leon font 25 | 26 | ....... 27 | .xxx... 28 | x...x.. 29 | x...x.. 30 | xxxxx.. 31 | x...x.. 32 | x...x.. 33 | x...x.. 34 | ....... 35 | ....... 36 | 37 | That way, a font can be stored using git and edited 38 | using standard text-editors in a reasonable way. 39 | 40 | I now use the font (leon) packaged in the git repo, 41 | it was pretty fun to design. 42 | 43 | -- mpu 44 | 45 | http://lists.suckless.org/dev/1512/28005.html 46 | 47 | 48 | 49 | 50 | Installing BDF fonts on Linux 51 | ----------------------------- 52 | 53 | # According to Debian's /etc/fonts/fonts.conf 54 | # ~/.fonts support is going to go away, when 55 | # that's the case, you can try to use 56 | # ~/.config/fonts below 57 | fontsdir=~/.fonts/ 58 | 59 | mkdir $fontsdir 60 | chmod go+rx $fontsdir 61 | 62 | sh 2bdf.sh FONTPATH > $fontsdir/myfont.bdf 63 | mkfontdir $fontsdir 64 | fc-cache -f 65 | 66 | xset fp+ $fontsdir # put this in .xinitrc 67 | xset fp rehash # put this in .xinitrc 68 | 69 | # That might not be sufficient. On my Debian 70 | # computer /etc/fonts/conf.d/70-no-bitmaps.conf 71 | # had to be removed. See [2] below. 72 | 73 | Extra information can also be found at: 74 | [1] https://www.freebsd.org/doc/handbook/x-fonts.html 75 | [2] https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts 76 | -------------------------------------------------------------------------------- /src/edit.c: -------------------------------------------------------------------------------- 1 | /* See LICENSE for legal matters. */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | struct { 9 | int x; 10 | int y; 11 | int cux; 12 | int cuy; 13 | int cx; 14 | int cy; 15 | WINDOW *mw; 16 | } scr; 17 | 18 | struct { 19 | int w; 20 | int h; 21 | char **bits; 22 | char path[128]; 23 | } gly; 24 | 25 | 26 | void panic(char *); 27 | void gshift(int, int); 28 | void gmirror(void); 29 | void sdraw(void); 30 | void treset(void); 31 | void tinit(void); 32 | void fparse(FILE *); 33 | void fdump(FILE *); 34 | 35 | void 36 | panic(char *s) 37 | { 38 | treset(); 39 | fprintf(stderr, "panic: %s\n", s); 40 | exit(1); 41 | } 42 | 43 | void 44 | gshift(int dx, int dy) 45 | { 46 | char **b; 47 | int y; 48 | char *row, **col; 49 | 50 | row = calloc(gly.w, 1); 51 | col = calloc(gly.h, sizeof (char *)); 52 | dx = (dx + gly.w) % gly.w; 53 | dy = (dy + gly.h) % gly.h; 54 | if (row && col) { 55 | b = gly.bits; 56 | memcpy(col, &b[dy], (gly.h - dy) * sizeof (char *)); 57 | memcpy(&col[gly.h - dy], b, dy * sizeof (char *)); 58 | memcpy(b, col, gly.h * sizeof (char *)); 59 | for (y=0; y': 247 | gshift(-1, 0); 248 | break; 249 | case '<': 250 | gshift(+1, 0); 251 | break; 252 | case '+': 253 | gshift(0, +1); 254 | break; 255 | case '-': 256 | gshift(0, -1); 257 | break; 258 | case '|': 259 | gmirror(); 260 | break; 261 | } 262 | scr.cux %= gly.w; 263 | scr.cuy %= gly.h; 264 | } 265 | } 266 | -------------------------------------------------------------------------------- /src/view.c: -------------------------------------------------------------------------------- 1 | /* See LICENSE for legal matters. */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | void panic(char *); 12 | void fload(void); 13 | void sdraw(void); 14 | void xinit(void); 15 | void xexpose(XEvent *); 16 | void xconfigure(XEvent *); 17 | void xbutton(XEvent *); 18 | void xkey(XEvent *); 19 | void tread(void); 20 | void sighup(int); 21 | 22 | void (*xhandler[LASTEvent])(XEvent *) = { 23 | [Expose] = xexpose, 24 | [ConfigureNotify] = xconfigure, 25 | [ButtonPress] = xbutton, 26 | [KeyPress] = xkey, 27 | }; 28 | struct { 29 | Display *dsp; 30 | Window win; 31 | GC gc; 32 | int scr; 33 | int w; 34 | int h; 35 | } xc; 36 | struct { 37 | unsigned *r; 38 | int nr; 39 | } txt; 40 | struct { 41 | char *path; 42 | int w; 43 | int h; 44 | char **g; 45 | int ng; 46 | } fnt; 47 | 48 | void 49 | panic(char *s) 50 | { 51 | fprintf(stderr, "panic: %s\n", s); 52 | exit(1); 53 | } 54 | 55 | void 56 | fload() 57 | { 58 | DIR *fd; 59 | FILE *f; 60 | int x, y; 61 | char *p, path[512]; 62 | struct dirent *de; 63 | unsigned r; 64 | 65 | p = strrchr(fnt.path, '/'); 66 | if (!p) 67 | p = fnt.path; 68 | else 69 | p++; 70 | if (sscanf(p, "%d x %d", &fnt.w, &fnt.h) != 2) 71 | panic("invalid font path"); 72 | fd = opendir(fnt.path); 73 | if (!fd) 74 | panic("cannot open font path"); 75 | while ((de = readdir(fd))) { 76 | if (sscanf(de->d_name, "U+%x", &r) != 1) 77 | continue; 78 | snprintf(path, sizeof path, "%s/%s", fnt.path, de->d_name); 79 | f = fopen(path, "r"); 80 | if (!f) 81 | continue; 82 | if (r >= fnt.ng) { 83 | fnt.g = realloc(fnt.g, (r+1) * sizeof (char *)); 84 | if (!fnt.g) 85 | panic("out of memory"); 86 | while (fnt.ng <= r) 87 | fnt.g[fnt.ng++] = 0; 88 | } 89 | fnt.g[r] = malloc(fnt.w * fnt.h); 90 | if (!fnt.g[r]) 91 | panic("out of memory"); 92 | for (y=0; yd_name); 108 | free(fnt.g[r]); 109 | fnt.g[r] = 0; 110 | break; 111 | } 112 | } 113 | fclose(f); 114 | } 115 | closedir(fd); 116 | } 117 | 118 | void 119 | sdraw() 120 | { 121 | char *g; 122 | unsigned *p; 123 | int cx, cy, x, y; 124 | 125 | XClearWindow(xc.dsp, xc.win); 126 | cx = 10; 127 | cy = 10; 128 | for (p=txt.r; p < &txt.r[txt.nr]; p++) { 129 | if (*p == '\n') { 130 | cx = 10; 131 | cy += fnt.h; 132 | continue; 133 | } 134 | if (*p < fnt.ng) 135 | g = fnt.g[*p]; 136 | else 137 | g = 0; 138 | if (g) 139 | for (x=0; xtype != KeyPress) 167 | return; 168 | n = XLookupString(&ev->xkey, str, sizeof str, 0, 0); 169 | if (n) { 170 | switch (str[0]) { 171 | case 'r': 172 | fload(); 173 | sdraw(); 174 | break; 175 | case 'q': 176 | case 'Q': 177 | XFreeGC(xc.dsp, xc.gc); 178 | XDestroyWindow(xc.dsp, xc.win); 179 | XCloseDisplay(xc.dsp); 180 | exit(0); 181 | } 182 | } 183 | } 184 | 185 | void 186 | xconfigure(XEvent *ev) 187 | { 188 | xc.w = ev->xconfigure.width; 189 | xc.h = ev->xconfigure.height; 190 | } 191 | 192 | void 193 | xinit(void) 194 | { 195 | XGCValues gcv; 196 | 197 | xc.dsp = XOpenDisplay(""); 198 | if (!xc.dsp) 199 | panic("cannot open display"); 200 | xc.scr = DefaultScreen(xc.dsp); 201 | xc.w = 100; 202 | xc.h = 100; 203 | xc.win = XCreateSimpleWindow( 204 | xc.dsp, RootWindow(xc.dsp, xc.scr), 0, 0, xc.w, xc.h, 0, 205 | BlackPixel(xc.dsp, xc.scr), WhitePixel(xc.dsp, xc.scr) 206 | ); 207 | XSelectInput(xc.dsp, xc.win, StructureNotifyMask|ExposureMask|ButtonPressMask|KeyPressMask); 208 | xc.gc = XCreateGC(xc.dsp, (Drawable)xc.win, 0, &gcv); 209 | XMapWindow(xc.dsp, xc.win); 210 | } 211 | 212 | void 213 | tread() 214 | { 215 | unsigned r; 216 | int c, rd, n; 217 | 218 | txt.nr = 1000; 219 | txt.r = malloc(txt.nr * sizeof (unsigned)); 220 | if (!txt.r) 221 | panic("out of memory"); 222 | n = 0; 223 | for (;;) { 224 | c = getchar(); 225 | if (c == EOF) 226 | break; 227 | if (c < 0x80) { 228 | rd = 0; 229 | r = c; 230 | } 231 | else if (c < 0xc0) { 232 | rd = 0; 233 | r = 0; 234 | } 235 | else if (c < 0xe0) { 236 | rd = 1; 237 | r = c & 0x1f; 238 | } 239 | else if (c < 0xf0) { 240 | rd = 2; 241 | r = c & 0xf; 242 | } 243 | else if (c < 0xf8) { 244 | rd = 3; 245 | r = c & 0x7; 246 | } 247 | else { 248 | rd = 0; 249 | r = 0; 250 | } 251 | while (rd--) { 252 | c = getchar(); 253 | r <<= 6; 254 | r |= c & 0x3f; 255 | } 256 | if (n == txt.nr) { 257 | txt.nr += 1000; 258 | txt.r = realloc(txt.r, txt.nr * sizeof (unsigned)); 259 | if (!txt.r) 260 | panic("out of memory"); 261 | } 262 | txt.r[n++] = r; 263 | } 264 | txt.nr = n; 265 | } 266 | 267 | void 268 | sighup(int sig) 269 | { 270 | XEvent ev; 271 | 272 | fload(); 273 | memset(&ev, 0, sizeof ev); 274 | ev.type = Expose; 275 | ev.xexpose.window = xc.win; 276 | XSendEvent(xc.dsp, xc.win, False, ExposureMask, &ev); 277 | XFlush(xc.dsp); 278 | } 279 | 280 | int 281 | main(int ac, char *av[]) 282 | { 283 | XEvent ev; 284 | 285 | if (ac < 2) { 286 | fprintf(stderr, "usage: view FONTDIR\n"); 287 | exit(1); 288 | } 289 | fnt.path = av[1]; 290 | signal(SIGHUP, sighup); 291 | fload(); 292 | tread(); 293 | xinit(); 294 | for (;;) { 295 | XNextEvent(xc.dsp, &ev); 296 | if (xhandler[ev.type]) 297 | xhandler[ev.type](&ev); 298 | } 299 | } 300 | --------------------------------------------------------------------------------