()
| 306 | |
| 307 | |
| 308 | def write_svg() -> None: |
| 309 | parts = [ |
| 310 | f'<svg xmlns="http://www.w3.org/2000/svg" width="{W}" height="{H}" viewBox="0 0 {W} {H}">', |
| 311 | '<rect width="100%" height="100%" fill="white"/>', |
| 312 | "<!-- The publication PDF/PNG is rendered from the same data by PIL. -->", |
| 313 | ] |
| 314 | for idx, panel in enumerate(PANELS): |
| 315 | x, y = panel_position(idx) |
| 316 | parts.append( |
| 317 | f'<rect x="{x}" y="{y + 72}" width="{PANEL_W}" height="{PANEL_H - 72}" ' |
| 318 | f'fill="rgb{BG}" stroke="rgb{NAVY}" stroke-width="4"/>' |
| 319 | ) |
| 320 | parts.append( |
| 321 | f'<text x="{x + PANEL_W / 2}" y="{y + 40}" text-anchor="middle" ' |
| 322 | f'font-family="Times New Roman" font-size="36" font-style="italic" ' |
| 323 | f'font-weight="700" fill="rgb{TITLE_RED}">{svg_escape(panel["title"])}</text>' |
| 324 | ) |
| 325 | parts.append("</svg>") |
| 326 | SVG_OUT.write_text("\n".join(parts), encoding="utf-8") |
| 327 | |
| 328 | |
| 329 | def main() -> None: |
no test coverage detected