Download level/_shared/common/font_utils.py from r1234chen/PuzzleMixEscape: direct link, hf CLI and curl.
- Browser
- Download file 254 Bytes
-
https://huggingface.co/datasets/r1234chen/PuzzleMixEscape/resolve/main/level/_shared/common/font_utils.py
- Command line
-
hf download hf://datasets/r1234chen/PuzzleMixEscape/level/_shared/common/font_utils.py
-
curl -L -o font_utils.py https://huggingface.co/datasets/r1234chen/PuzzleMixEscape/resolve/main/level/_shared/common/font_utils.py
254 Bytes
| from pathlib import Path | |
| from PIL import ImageFont | |
| _FONT = Path(__file__).resolve().parents[3] / 'runtime' / 'native_runtime' / 'fonts' / 'DejaVuSansMono.ttf' | |
| def load_font(size): | |
| return ImageFont.FreeTypeFont(str(_FONT), max(9, int(size))) | |