fix #33
This commit is contained in:
parent
5183dbfb25
commit
44c07a64d9
@ -43,6 +43,9 @@ from Difficult_Rocket.exception.language import LanguageNotFound
|
|||||||
from Difficult_Rocket.client.screen import DRScreen, DRDEBUGScreen
|
from Difficult_Rocket.client.screen import DRScreen, DRDEBUGScreen
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger('client')
|
||||||
|
|
||||||
|
|
||||||
class ClientOption(Options):
|
class ClientOption(Options):
|
||||||
fps: int = 60
|
fps: int = 60
|
||||||
width: int = 1024
|
width: int = 1024
|
||||||
@ -107,9 +110,15 @@ def pyglet_load_fonts_folder(folder) -> None:
|
|||||||
file_folder_list = os.listdir(folder)
|
file_folder_list = os.listdir(folder)
|
||||||
for obj in file_folder_list:
|
for obj in file_folder_list:
|
||||||
if os.path.isfile(os.path.join(folder, obj)):
|
if os.path.isfile(os.path.join(folder, obj)):
|
||||||
if obj[-4:] == '.ttf':
|
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))
|
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:
|
else:
|
||||||
|
logger.info(f'loading font folder {os.path.join(folder, obj)}')
|
||||||
pyglet_load_fonts_folder(os.path.join(folder, obj))
|
pyglet_load_fonts_folder(os.path.join(folder, obj))
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,6 +4,13 @@
|
|||||||
- 最新版本号
|
- 最新版本号
|
||||||
- DR sdk: 0.8.3.0
|
- 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
|
## DR sdk 0.8.3.0
|
||||||
|
|
||||||
### 删除
|
### 删除
|
||||||
|
Loading…
Reference in New Issue
Block a user