Skip to content

Names, ward labels, windrose and other map dressings #6

Description

@barrulus

Wanted

Names, windroses and other map dressings, all opt-in (reference: MFCG's Dragonbark Keep — title at top, curved ward labels like OLD CITY / SILK BANK / MILKFORD along their wards, road labels like GREEN ROAD / COPPER CROSS following the road, windrose in the corner):

  • Settlement title — render the town's name (FMG already knows it; needs a name field threaded through AzgaarBurgInputGenerationParams).
  • Ward labels — if wards are named, label them; text arcs along the ward's extent rather than sitting horizontal. Caller-supplied names should be possible (FMG or user), with generated fallbacks optional.
  • Road/gate labels — named roads curve along the road polyline (SVG textPath territory).
  • Windrose / compass — a corner decoration; needs a symbol-library asset (none exists in the manifest today).
  • Other dressings later: scale bar, map grid, border.

We can borrow heavily from the bazgaars-fmg fork's WebGL label work for placement and curvature logic.

Current state

  • No settlement name exists anywhere in the pipeline or output.
  • Ward.getLabel() (src/wards/ward.ts:234) already returns per-ward type labels, but they only surface as a GeoJSON property (src/output/geojson-builder.ts:76) — the SVG renderer never draws text at all.
  • src/output/svg-builder.ts has 9 paint passes (bg→fields→greens→water→roads→shadows→buildings→landmarks→walls), none for annotations.
  • No windrose/compass symbol in src/assets/symbol-manifest.ts.

Notes

  • Labels must be a separate paint pass / layer and default-off, so machine consumers are unaffected: settlement-tiler's cropSvgToTile and the data-bg="paper" contract must keep working, and the tiler may want to exclude labels or only render them at high zoom.
  • Font strategy needs deciding: SVG text with a font-family stack keeps the zero-dep contract; embedding a font does not.
  • Curved text = <textPath> over generated guide paths (ward medial axis / road centreline); the fork's WebGL approach solves placement, we solve it once and emit paths.

Pointers

  • src/output/svg-builder.ts — paint passes, render-theme.ts for label colours per palette
  • src/output/geojson-builder.ts:76 — existing label plumbing
  • src/wards/ward.ts:234getLabel()
  • bazgaars-fmg fork — WebGL labels implementation to crib placement/curvature from

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions