代码拉取完成,页面将自动刷新
import btree
class font16x16:
def __init__(self):
try:
self.f=open('gbk16x16.btree','rb') #打开文件
self.fontDB=btree.open(self.f) #打开数据库
except OSError:
self.f=None
self.fontDB=None
print('Failed to load the fontDB!')
def deinit(self):
if self.fontDB is not None:
self.fontDB.close()
self.f.close()
def get(self,ch:str):
if self.fontDB is None:
return 0,0,bytearray()
else:
bm=bytearray(self.fontDB.get(ch[0].encode(),self.fontDB[b"*"])) #在数据库内查找文字点阵图
w=len(bm)//2
return w,16,bm #返回字符信息
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。