Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easyofd.draw.font_tools:register_font:96 - register_font_error: 'name' #23

Open
CellMook opened this issue Jul 22, 2024 · 3 comments
Open

Comments

@CellMook
Copy link

代码:demo.py中的 test_ofd2

错误信息:| ERROR | easyofd.draw.font_tools:register_font:96 - register_font_error:
'name'
Traceback (most recent call last):
File "D:\anaconda3\envs\py312\Lib\site-packages\easyofd\draw\font_tools.py", line 91, in register_font
pdfmetrics.registerFont(TTFont(FontName, file_name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\envs\py312\Lib\site-packages\reportlab\pdfbase\ttfonts.py", line 1192, in init
self.face = TTFontFace(filename, validate=validate, subfontIndex=subfontIndex)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\envs\py312\Lib\site-packages\reportlab\pdfbase\ttfonts.py", line 1073, in init
TTFontFile.init(self, filename, validate=validate, subfontIndex=subfontIndex)
File "D:\anaconda3\envs\py312\Lib\site-packages\reportlab\pdfbase\ttfonts.py", line 440, in init
self.extractInfo(charInfo)
File "D:\anaconda3\envs\py312\Lib\site-packages\reportlab\pdfbase\ttfonts.py", line 471, in extractInfo
name_offset = self.seek_table("name")
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\envs\py312\Lib\site-packages\reportlab\pdfbase\ttfonts.py", line 291, in seek_table
self._pos = self.get_table_pos(tag)[0] + offset_in_table
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\anaconda3\envs\py312\Lib\site-packages\reportlab\pdfbase\ttfonts.py", line 276, in get_table_pos
offset = self.table[tag]['offset']
~~~~~~~~~~^^^^^
KeyError: 'name'

@renoyuan
Copy link
Owner

ofd文件发我

@CellMook
Copy link
Author

发邮箱了

@renoyuan
Copy link
Owner

该文件的字体 为自定义的OpenType 内嵌字体,目前不支持解析和转换。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants