From 5c09bfe8493e2d207997ae2cf97ad20173468bf4 Mon Sep 17 00:00:00 2001 From: Walkline Wang Date: Sat, 14 Aug 2021 23:27:59 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 7991910..b3035f5 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,23 @@ $ client/FontMaker_Cli.exe > 目前这个命令行软件还不支持输入参数进行定制生成字库文件,运行后默认使用的参数如下: > > 字体:幼圆 + > 字号:16 像素 + > 字重:普通(不加粗、不斜体、无下划线) + > 字符宽度:固定 + > 字符宽度:16 像素 + > 字符高度:16 像素 + > 水平偏移:0 像素 + > 垂直偏移:0 像素 + > 扫描方式:行扫描 + > 字节顺序:高位在前 #### 使用电脑测试 -- Gitee From 83775a42c872edb1a751125ad0fe780202444811 Mon Sep 17 00:00:00 2001 From: Walkline Wang Date: Mon, 16 Aug 2021 14:17:23 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AD=90=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client b/client index f41014c..a2de25e 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit f41014c6c12440894152b05dac4c65843238d2ed +Subproject commit a2de25ed7f22598f2b1ae5b10c8cffa5ba24868d -- Gitee From 244a57bda205ef9b532b6b328da0de56fa97317a Mon Sep 17 00:00:00 2001 From: Walkline Wang Date: Mon, 16 Aug 2021 23:16:51 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AD=90=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client b/client index a2de25e..cc516ad 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit a2de25ed7f22598f2b1ae5b10c8cffa5ba24868d +Subproject commit cc516ad64bbd2810db4422b0e431c2014fbda1e9 -- Gitee From 6b254f74bcba1f84e08f1d2f8216fe99c37292aa Mon Sep 17 00:00:00 2001 From: Walkline Wang Date: Mon, 16 Aug 2021 23:17:03 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20ab=20=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abconfig | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 abconfig diff --git a/abconfig b/abconfig new file mode 100644 index 0000000..70d320a --- /dev/null +++ b/abconfig @@ -0,0 +1,2 @@ +# client/combined.bin +drivers/ssd1306.py -- Gitee From 4c4667e5f2797194336fa4b36b3029fde49edf12 Mon Sep 17 00:00:00 2001 From: Walkline Wang Date: Tue, 17 Aug 2021 00:11:08 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AD=97=E5=BA=93?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=AF=BB=E5=8F=96=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fontlib.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fontlib.py b/fontlib.py index 1620d56..5ecae72 100644 --- a/fontlib.py +++ b/fontlib.py @@ -72,7 +72,7 @@ class FontLib(object): self.__header = None with open(self.__font_filename, 'rb') as font_file: - self.__header = FontLibHeader(font_file.read(FontLibHeader.LENGTH)) + self.__header = FontLibHeader(memoryview(font_file.read(FontLibHeader.LENGTH))) self.__placeholder_buffer = self.__get_character_unicode_buffer(font_file, {ord('?')})[0][1] gc.collect() @@ -86,17 +86,24 @@ class FontLib(object): def __get_character_unicode_buffer(self, font_file, unicode_set): buffer_list = [] + def __seek(data, target): + for index in range(0, 1000, 2): + if data[index: index + 2] == target: + return offset + index + else: + return 0 + for unicode in unicode_set: if self.__is_ascii(unicode): char_offset = self.__header.ascii_start + (unicode - 0x20) * self.__header.data_size elif self.__is_gb2312(unicode): - gb2312_index = struct.pack('