Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# An utility repo to load conveniently fonts using hf_hub_download:
|
2 |
+
|
3 |
+
```python
|
4 |
+
from huggingface_hub import hf_hub_download
|
5 |
+
from PIL import ImageFont
|
6 |
+
|
7 |
+
font_path = hf_hub_download("jonathang/fonts-ttf", "Vogue.ttf")
|
8 |
+
font_obj = ImageFont(font_path, encoding="UTF-8")
|
9 |
+
```
|
10 |
+
|
11 |
+
(based on https://huggingface.co/ybelkada/fonts)
|