Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fonts
|
| 2 |
+
|
| 3 |
+
An utility repo to load conveniently fonts using `hf_hub_download`:
|
| 4 |
+
|
| 5 |
+
```python
|
| 6 |
+
from huggingface_hub import hf_hub_download
|
| 7 |
+
from PIL import ImageFont
|
| 8 |
+
|
| 9 |
+
font_path = hf_hub_download("AntonV/ernie4_5_fonts", "Roboto-Regular.ttf")
|
| 10 |
+
font_obj = ImageFont.truetype(font_path)
|
| 11 |
+
```
|