Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import os
|
|
| 2 |
import json
|
| 3 |
import shutil
|
| 4 |
import gradio as gr
|
|
|
|
| 5 |
|
| 6 |
from fonts import setup_fonts
|
| 7 |
from converter import convert_qurancaption_to_qvm
|
|
@@ -16,6 +17,33 @@ from renderer import render_final_video
|
|
| 16 |
|
| 17 |
setup_fonts()
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
os.makedirs("uploads", exist_ok=True)
|
| 20 |
os.makedirs("temp", exist_ok=True)
|
| 21 |
os.makedirs("outputs", exist_ok=True)
|
|
|
|
| 2 |
import json
|
| 3 |
import shutil
|
| 4 |
import gradio as gr
|
| 5 |
+
import subprocess
|
| 6 |
|
| 7 |
from fonts import setup_fonts
|
| 8 |
from converter import convert_qurancaption_to_qvm
|
|
|
|
| 17 |
|
| 18 |
setup_fonts()
|
| 19 |
|
| 20 |
+
for f in os.listdir("fonts"):
|
| 21 |
+
|
| 22 |
+
if f.endswith(".ttf") or f.endswith(".otf"):
|
| 23 |
+
|
| 24 |
+
path = os.path.join(
|
| 25 |
+
"fonts",
|
| 26 |
+
f
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
print("\n" + "=" * 50)
|
| 30 |
+
print("FONT INFO:", f)
|
| 31 |
+
print("=" * 50)
|
| 32 |
+
|
| 33 |
+
try:
|
| 34 |
+
|
| 35 |
+
result = subprocess.run(
|
| 36 |
+
["fc-scan", path],
|
| 37 |
+
capture_output=True,
|
| 38 |
+
text=True
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
print(result.stdout[:3000])
|
| 42 |
+
|
| 43 |
+
except Exception as e:
|
| 44 |
+
|
| 45 |
+
print(e)
|
| 46 |
+
|
| 47 |
os.makedirs("uploads", exist_ok=True)
|
| 48 |
os.makedirs("temp", exist_ok=True)
|
| 49 |
os.makedirs("outputs", exist_ok=True)
|