Glyph API

Generate customizable glyph SVGs

GET /api/v1/glyph/svg Available
GET /api/v1/glyph/png Available

Playground

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

ParameterTypeRequiredDescriptionExample
duodstringGlyph identifier (0-9, A-B)0, 5, A
heightnumberHeight value for the glyph100
bordernumberBorder width5
thiccnessnumberThickness of glyph elements10
barJSON arrayFraction array for bar elements[1,2]
colorstringPrimary color (CSS color)blue, #FF0000
fillJSON arrayFill colors array["red", "blue"]
viewBoxstringSVG viewBox attribute0 0 100 100
colorizedbooleanEnable colorizationtrue, false
svgWstringSVG width attribute200
svgHstringSVG height attribute200
borderColorstringBorder color (CSS color)black, #000000
backgroundColorstringBackground 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
Basic glyph

Colored Glyph with Height

GET /api/v1/glyph/svg?duod=5&height=100&color=red
Colored glyph

Complex Glyph with Multiple Parameters

GET /api/v1/glyph/svg?duod=A&height=150&border=5&thiccness=15&color=blue&colorized=true
Complex glyph

Glyph with Custom Dimensions

GET /api/v1/glyph/svg?duod=7&svgW=300&svgH=200&backgroundColor=lightgray
Custom dimensions glyph

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 bar or fill parameters 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

ParameterTypeDescriptionExample
scalenumberScale factor for higher resolution2, 3, 4
pngWidthnumberTarget width in pixels400, 800
pngHeightnumberTarget height in pixels300, 600
pngBackgroundstringBackground 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