This commit is contained in:
shenjack 2023-06-17 18:31:06 +08:00
parent 5183dbfb25
commit 44c07a64d9
2 changed files with 18 additions and 2 deletions

View File

@ -43,6 +43,9 @@ from Difficult_Rocket.exception.language import LanguageNotFound
from Difficult_Rocket.client.screen import DRScreen, DRDEBUGScreen
logger = logging.getLogger('client')
class ClientOption(Options):
fps: int = 60
width: int = 1024
@ -107,9 +110,15 @@ def pyglet_load_fonts_folder(folder) -> None:
file_folder_list = os.listdir(folder)
for obj in file_folder_list:
if os.path.isfile(os.path.join(folder, obj)):
if obj[-4:] == '.ttf':
pyglet.font.add_file(os.path.join(folder, obj))
if obj[-4:] == '.ttf' or obj[-4:] == '.otf':
logger.debug(f'loading font {os.path.join(folder, obj)}')
try:
pyglet.font.add_file(os.path.join(folder, obj))
except Exception:
logger.error(traceback.format_exc())
logger.error(f'loading font {os.path.join(folder, obj)} failed')
else:
logger.info(f'loading font folder {os.path.join(folder, obj)}')
pyglet_load_fonts_folder(os.path.join(folder, obj))

View File

@ -4,6 +4,13 @@
- 最新版本号
- DR sdk: 0.8.3.0
## DR sdk 0.8.3.1
### Fix
- issue #33 (https://github.com/shenjackyuanjie/Difficult-Rocket/issues/33)
- 修复了实际上并不会加载 `.otf` 格式的字体文件的问题
## DR sdk 0.8.3.0
### 删除