Next: , Previous: , Up: API  


1.8 (ggg svg)

1.8.1 Procedures

Procedure: length-for-text text KEY: #:font-size #:padding

Estimate the width of a badge section in pixels: TEXT at FONT-SIZE plus PADDING on both sides, drawn at BADGE-SCALE. The per-character widths are averages for the sans-serif stack badges use, so a badge stays as compact as the ones shields.io and GitHub render. The result is rounded to a whole pixel.

Procedure: rounded value

VALUE rounded to two decimals, so that a coordinate built by adding or subtracting scaled dimensions stays short in the SVG.

Procedure: scaled value

VALUE scaled by BADGE-SCALE, rounded to two decimals so that coordinates stay short in the SVG.

1.8.2 Variables

Variable: badge-scale
1.0918