1// Package icons carries the standard icon library the ingestion pipeline2// enriches icon-less sources from: a curated subset of Mapbox's Maki set,3// public-domain map glyphs vendored here so the enrichment is as offline as4// everything else. The app never learns this package exists -- a resolved5// standard icon is one more asset in a bundle's icons tree, tinted and6// haloed like any glyph a source shipped itself.7//8// Only the names some translator actually speaks are vendored; the embed is9// the vocabulary, and a name outside it is a build error at resolution10// time, one table edit old.11package icons1213import (14 "embed"15 "fmt"16 "strings"17)1819//go:embed standard/maki/*.svg standard/maki/LICENSE.txt20var standard embed.FS2122// Standard resolves a set/name reference from the atlas.icon.std attribute23// to the icon's bytes and the asset name it ships under. The asset name24// spells its provenance -- std--maki-mountain.svg -- so a bundle listing25// reads honestly and a source's own artwork can never be shadowed by it.26func Standard(ref string) ([]byte, string, error) {27 set, name, found := strings.Cut(ref, "/")28 if !found || set != "maki" {29 return nil, "", fmt.Errorf("standard icon %q is not in a vendored set", ref)30 }31 data, err := standard.ReadFile("standard/maki/" + name + ".svg")32 if err != nil {33 return nil, "", fmt.Errorf("standard icon %q is not vendored", ref)34 }35 return data, "std--maki-" + name + ".svg", nil36}