UDHOV commited on
Commit
a48f7a5
·
1 Parent(s): 3d27309

fixed font path for HF Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -7
Dockerfile CHANGED
@@ -23,19 +23,21 @@ RUN pip install --no-cache-dir --upgrade pip && \
23
  # Copy all app files
24
  COPY . .
25
 
26
- # Download Kalimati font directly (avoids committing binary to git)
27
  RUN mkdir -p /app/fonts && \
28
- curl -L "https://github.com/googlefonts/nepali-fonts/raw/main/fonts/Kalimati/Kalimati-Regular.ttf" \
29
- -o /app/fonts/Kalimati.ttf || \
30
- curl -L "https://github.com/virtual-labs/virtual-labs.github.io/raw/master/fonts/Kalimati.ttf" \
31
- -o /app/fonts/Kalimati.ttf || \
32
- echo "WARNING: Kalimati font download failed, falling back to Noto Sans Devanagari"
33
 
34
  # Register Kalimati font with system font cache
35
  RUN if [ -f /app/fonts/Kalimati.ttf ]; then \
36
  mkdir -p /usr/local/share/fonts/nepali && \
37
  cp /app/fonts/Kalimati.ttf /usr/local/share/fonts/nepali/ && \
38
- fc-cache -fv; \
 
 
 
39
  fi
40
 
41
  # Set environment variables
 
23
  # Copy all app files
24
  COPY . .
25
 
26
+ # Download Kalimati font using reliable GitHub raw URL
27
  RUN mkdir -p /app/fonts && \
28
+ curl -fL "https://github.com/mhnpd/nepali-font/raw/master/fonts/Kalimati.ttf" \
29
+ -o /app/fonts/Kalimati.ttf && \
30
+ echo "✅ Kalimati downloaded: $(wc -c < /app/fonts/Kalimati.ttf) bytes" || \
31
+ echo "⚠️ Kalimati download failed — NotoSansDevanagari will be used as fallback"
 
32
 
33
  # Register Kalimati font with system font cache
34
  RUN if [ -f /app/fonts/Kalimati.ttf ]; then \
35
  mkdir -p /usr/local/share/fonts/nepali && \
36
  cp /app/fonts/Kalimati.ttf /usr/local/share/fonts/nepali/ && \
37
+ fc-cache -fv && \
38
+ echo "✅ Kalimati font registered with system"; \
39
+ else \
40
+ echo "⚠️ Skipping font registration — file not found"; \
41
  fi
42
 
43
  # Set environment variables