Glyph API
Generate customizable glyph SVGs
GET
/api/v1/glyph/svg AvailableGET
/api/v1/glyph/png AvailablePlayground
Test the Glyph API in real-time by editing the URL below. The image will update automatically as you type.
Quick Presets:
Description
The Glyph API generates individual glyph SVGs with extensive customization options. Glyphs can be styled with colors, borders, dimensions, and mathematical fractions.
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
duod | string | ❌ | Glyph identifier (0-9, A-B) | 0, 5, A |
height | number | ❌ | Height value for the glyph | 100 |
border | number | ❌ | Border width | 5 |
thiccness | number | ❌ | Thickness of glyph elements | 10 |
bar | JSON array | ❌ | Fraction array for bar elements | [1,2] |
color | string | ❌ | Primary color (CSS color) | blue, #FF0000 |
fill | JSON array | ❌ | Fill colors array | ["red", "blue"] |
viewBox | string | ❌ | SVG viewBox attribute | 0 0 100 100 |
colorized | boolean | ❌ | Enable colorization | true, false |
svgW | string | ❌ | SVG width attribute | 200 |
svgH | string | ❌ | SVG height attribute | 200 |
borderColor | string | ❌ | Border color (CSS color) | black, #000000 |
backgroundColor | string | ❌ | Background color (CSS color) | white, #FFFFFF |
Response
Headers
Content-Type: image/svg+xml
Cache-Control: public, max-age=31536000, immutable Body
Valid SVG markup representing the generated glyph
Examples
Basic Glyph
GET /api/v1/glyph/svg?duod=0 Colored Glyph with Height
GET /api/v1/glyph/svg?duod=5&height=100&color=red Complex Glyph with Multiple Parameters
GET /api/v1/glyph/svg?duod=A&height=150&border=5&thiccness=15&color=blue&colorized=true Glyph with Custom Dimensions
GET /api/v1/glyph/svg?duod=7&svgW=300&svgH=200&backgroundColor=lightgray Usage in HTML
The generated SVGs can be embedded directly in HTML:
<img src="/api/v1/glyph/svg?duod=0&height=100&color=blue" alt="Glyph" /> Or used as background images in CSS:
background-image: url('/api/v1/glyph/svg?duod=5&color=red');Error Handling
The API handles invalid parameters gracefully:
- Invalid JSON in
barorfillparameters will be ignored - Invalid colors will fall back to default values
- Invalid numeric values will be ignored
- Unknown parameters are ignored
PNG Endpoint
Available: PNG endpoints are now fully functional and ready for production use!
PNG endpoints accept all the same parameters as SVG endpoints, plus additional PNG-specific options:
PNG-Specific Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
scale | number | Scale factor for higher resolution | 2, 3, 4 |
pngWidth | number | Target width in pixels | 400, 800 |
pngHeight | number | Target height in pixels | 300, 600 |
pngBackground | string | Background color or "transparent" | white, transparent, #FF0000 |
PNG endpoints are perfect for:
- High-resolution graphics and printing
- Social media sharing and embedding
- Applications that don't support SVG
- Thumbnail generation
- Email newsletters and marketing materials