Skip to content

Commit

Permalink
调整错误文案
Browse files Browse the repository at this point in the history
  • Loading branch information
TakWolf committed Jul 10, 2024
1 parent eb8f73f commit 931a2ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tools/configs/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def load() -> dict[str, 'FontConfig']:
fallback_upper_from_lower,
preview_text,
)
assert config.outputs_name == file_dir.name, f"Config 'name' error: '{file_path}'"
assert (config.line_height - font_size) % 2 == 0, f"Config 'line_height' error: '{file_path}'"
assert config.outputs_name == file_dir.name, f"config 'name' error: '{file_path}'"
assert (config.line_height - font_size) % 2 == 0, f"config 'line_height' error: '{file_path}'"
configs.append(config)
configs.sort(key=lambda x: x.name)
return {config.outputs_name: config for config in configs}
Expand Down
6 changes: 3 additions & 3 deletions tools/services/check_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def check_glyph_files(font_config: FontConfig):
file_dir = font_config.glyphs_dir.joinpath(f'{block.code_start:04X}-{block.code_end:04X} {block.name}')
file_path = file_dir.joinpath(file_name)

assert glyph_file.file_path == file_path, f"[{font_config.outputs_name}] Glyph file path is not standardized: '{glyph_file.file_path}' -> '{file_path}'"
assert glyph_file.file_path == file_path, f"[{font_config.outputs_name}] glyph file path is not standardized: '{glyph_file.file_path}' -> '{file_path}'"

assert glyph_file.height == font_config.line_height, f"[{font_config.outputs_name}] Glyph data error: '{glyph_file.file_path}'"
assert glyph_file.height == font_config.line_height, f"[{font_config.outputs_name}] glyph data error: '{glyph_file.file_path}'"

glyph_bytes = BytesIO()
glyph_file.bitmap.dump_png(glyph_bytes)
assert glyph_file.file_path.read_bytes() == glyph_bytes.getvalue(), f"[{font_config.outputs_name}] Glyph file data is not standardized: '{glyph_file.file_path}'"
assert glyph_file.file_path.read_bytes() == glyph_bytes.getvalue(), f"[{font_config.outputs_name}] glyph file data is not standardized: '{glyph_file.file_path}'"
2 changes: 1 addition & 1 deletion tools/services/format_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def format_glyph_files(font_config: FontConfig):
file_path = file_dir.joinpath(file_name)

if glyph_file.file_path != file_path:
assert not file_path.exists(), f"[{font_config.outputs_name}] Glyph file duplication: '{glyph_file.file_path}' -> '{file_path}'"
assert not file_path.exists(), f"[{font_config.outputs_name}] glyph file duplication: '{glyph_file.file_path}' -> '{file_path}'"
file_dir.mkdir(parents=True, exist_ok=True)
glyph_file.file_path.rename(file_path)
logger.info("Format glyph file path: '{}' -> '{}'", glyph_file.file_path, file_path)
Expand Down

0 comments on commit 931a2ce

Please sign in to comment.