|
Download docs/fonts.md from boonthongvxy/lao-python-learn: direct link, hf CLI and curl.
- Browser
- Download file 1.88 kB
-
https://huggingface.co/spaces/boonthongvxy/lao-python-learn/resolve/main/docs/fonts.md
- Command line
-
hf download hf://spaces/boonthongvxy/lao-python-learn/docs/fonts.md
-
curl -L -o fonts.md https://huggingface.co/spaces/boonthongvxy/lao-python-learn/resolve/main/docs/fonts.md
1.88 kB
| # Google Fonts for Lao Script | |
| ## Recommended Font: Noto Sans Lao | |
| ### Why Noto Sans Lao? | |
| **Comprehensive Coverage:** | |
| - Supports all Lao script characters (tones, diacritics, special characters) | |
| - Includes both Lao and Thai characters (useful for mixed content) | |
| - Well-tested across all browsers and operating systems | |
| **Google Fonts Integration:** | |
| ```css | |
| @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@400;500;600;700&display=swap'); | |
| ``` | |
| **Weights Available:** | |
| - `400` - Regular | |
| - `500` - Medium | |
| - `600` - Semi-bold | |
| - `700` - Bold | |
| ## Alternative Options | |
| ### 1. Phetsarath OT | |
| - Traditional Lao font | |
| - Built into many systems | |
| - Less modern appearance | |
| ### 2. Saysettha OT | |
| - Another traditional option | |
| - Good coverage but less common online | |
| ### 3. Lao Sans Pro | |
| - Commercial font (not free) | |
| - Excellent quality but requires license | |
| ## Implementation in Our App | |
| ```python | |
| custom_css = """ | |
| @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@400;500;600;700&display=swap'); | |
| body, .gradio-container, textarea, input, button, select { | |
| font-family: 'Noto Sans Lao', sans-serif !important; | |
| } | |
| code, pre { | |
| font-family: 'Courier New', monospace !important; | |
| } | |
| """ | |
| ``` | |
| ## Testing | |
| The font is now active in our Lao Python Learning Platform: | |
| - **URL:** https://e96a02c050d0658aec.gradio.live | |
| - **Status:** β Noto Sans Lao loading correctly | |
| - **Verification:** All Lao text renders properly (no missing glyphs) | |
| ## Browser Support | |
| Noto Sans Lao works on: | |
| - β Chrome/Edge (best support) | |
| - β Firefox | |
| - β Safari | |
| - β Mobile browsers (iOS/Android) | |
| ## Notes | |
| 1. **First-load delay:** Google Fonts may cause slight delay on first visit (solved with `display=swap`) | |
| 2. **Offline:** Font won't load without internet (acceptable for web platform) | |
| 3. **Fallback:** System falls back to default sans-serif if font fails to load | |