Why do icon-font codepoints change when icons are added?
A generator that derives codepoints from the current source list can shift assignments when the list changes. Insert an icon whose name sorts early, rename a file, or start a new browser import without restoring the previous project, and every icon after that point can move.
The font itself is then internally consistent, so nothing fails at build time. The breakage appears in application code that still refers to the old value: a constant for a back arrow keeps pointing at U+E001 while U+E001 now contains a different glyph. The icon renders, it is simply the wrong picture.
How does GlyphPact keep existing codepoints stable?
GlyphPact writes a lock file, iconfont.lock.json, into the generated output directory and reads it back on every later build. Each entry records the source path, the Dart name, the assigned codepoint, and content hashes. An assignment already in the lock is reused as-is; only genuinely new sources draw new codepoints from the end of the allocated range.
Removing an icon does not free its codepoint. The entry moves to a "retired" list in the same file, leaving a permanent tombstone so the value is never handed to a different picture. Restoring the source later reactivates the original slot, and a unique content-preserving rename keeps both its codepoint and its generated Dart name.
How the lock file works
Should iconfont.lock.json be committed to Git?
Yes. The lock file is the codepoint ABI for the generated font, and it only protects existing assignments if the next build can read the same file the previous build wrote. Committing it alongside the generated font, Dart provider, report, and attribution file is the intended workflow.
If the lock is deleted or lost, the next build has no record of prior assignments and will allocate codepoints from scratch, which can reassign icons even when no source file changed.
How can CI detect stale generated icon output?
Run the same GlyphPact build with the --check flag: glyphpact --config icon_font.json --check. It rebuilds a candidate artifact set from the current sources and compares it against the committed output without rewriting the owned output directory.
Exit code 0 means the committed artifacts are current, and exit code 3 means they are stale, which fails the job. Adding --json produces a stable machine-readable result at schema version 2 so a workflow can inspect glyph counts, the active policy, and typed issues rather than treating every successful run as equivalent.
CI setup for Flutter projects
Does GlyphPact work offline?
Yes. GlyphPact is a command-line compiler that runs locally. Compiling a pack involves no network access: there is no website step, no project service, and no server that receives your artwork. Installation itself needs the network once, to fetch the package.
Does GlyphPact upload my SVG files anywhere?
No. Source SVGs are read from disk and all compilation happens in the local process. Nothing is transmitted, so unreleased or licence-restricted artwork never leaves the machine or the build runner.
Can I use the generated font outside Flutter?
Partly, and the boundary is worth stating precisely. The compiled OpenType/CFF font, the lock registry, and iconfont.report.json are framework-neutral. Report schema v3 records every emitted glyph name and codepoint plus the font family, file, hashes, layered metadata, and remaining allocation capacity, so it is the stable lower-level input for another language's generator.
The generated high-level binding is Dart-specific: it contains const Flutter IconData values and, when enabled, a name-keyed catalog companion. GlyphPact does not generate a ready-made web, React, Android, or JavaScript binding.
A non-Flutter project can consume the font and generate its own integration from the report. That custom output must live outside GlyphPact's owned output directory and needs its own drift check.
Does GlyphPact generate CSS or WOFF2?
No. GlyphPact emits an OpenType/CFF .otf font, the lock registry, a machine-readable report, an attribution file, and a Dart provider. It does not produce WOFF, WOFF2, or any stylesheet, and it has no browser integration.
Using the font on the web is possible but manual: convert the .otf to WOFF2 with a separate tool and write the @font-face rule and class names yourself. Active glyph names and codepoints can be read from iconfont.report.json. If a turnkey web icon-font pipeline is what you need, a web-first generator is the better fit today.
What happens when an SVG contains features an icon font cannot represent?
The source is classified rather than silently approximated. An icon-font glyph stores monochrome alpha coverage, so features like a Gaussian blur filter or surviving fractional transparency have no faithful representation in it.
GlyphPact sorts each source into one of three outcomes. Lossless sources are normalized and emitted automatically. Deterministically approximable sources are emitted only when the lossy policy is set to convert, and are reported as a typed lossy issue. Sources with no faithful conversion are omitted only when the unrepresentable policy is set to skip, and are reported as a typed unrepresentable issue.
Both policies default to error, so by default an affected build fails and prints the diagnostic code, the file, and the feature instead of shipping a wrong-looking icon. Malformed, unsafe, or unknown input, and exhausted resource limits, always fail regardless of policy.
The versioned SVG profile
Is GlyphPact an IcoMoon alternative?
Yes, when the requirement is a repository-managed Flutter icon pipeline. Both tools import SVG folders, run locally or offline, and can generate Flutter output.
IcoMoon is stronger for visual editing, bundled libraries, and broad output formats. Its current app exports a Dart class for Flutter, imports files and folders, and can replace glyphs by matching names while retaining their metadata.
GlyphPact is different at the build boundary. It provides a first-party local compiler, a committed codepoint lock with permanent tombstones, typed SVG audit results, byte-identical rebuilds, and a --check command that fails CI when generated output is stale.
Full IcoMoon comparison
Can GlyphPact convert a folder of SVGs to Flutter IconData?
Yes. Point the GlyphPact CLI at an SVG directory and choose an output directory and class name. One build emits an OpenType/CFF icon font, a const Flutter IconData provider, iconfont.lock.json, iconfont.report.json, and ATTRIBUTION.md.
The generated output is meant to be committed. Later builds reuse the lock so adding another SVG batch does not renumber existing IconData constants.
Bulk SVG workflow
Can Flutter code enumerate every generated icon by name?
Yes. Set catalog to true in the checked-in GlyphPact config. The existing generated Dart file then includes a separate AppIconsCatalog companion whose static const byName map contains every emitted IconData in ascending codepoint order. Packs with partial-alpha icons also receive layeredByName for their lossless layered descriptors.
The config switch alone does not enlarge a release. If the catalog is unreachable, Flutter removes it and subsets the font from the individual provider constants the app uses. Reachable byName retains every base glyph, while reachable layeredByName retains those icons' fallbacks and layer-font glyphs. A catalog referenced only from tests has no release cost.
For another collection shape, order, variable name, or language, use report schema v3 as a build-time input. Report codepoints are 0x... strings, and codepointsRemaining plus rangeUtilization expose the current allocation headroom. Generated Dart should reference the reported provider constants rather than constructing IconData dynamically, and custom generated files must stay outside GlyphPact's owned output directory.
Flutter integration details
Which coding agents can use the GlyphPact MCP server?
Any client that can start a local stdio MCP server can use GlyphPact. The documented setups cover Claude Code, Codex, Antigravity, Cursor, JetBrains AI Assistant, VS Code, Zed, Windsurf, and Gemini CLI. Clients use different JSON keys, TOML sections, and config locations, but each one launches the same published glyphpact-mcp process.
The server has four tools: audit an SVG file or directory and page a stable local findings snapshot, build the output declared by a config, check generated output for staleness without rewriting the artifact set, and page a published report. It also exposes the config, report, and inner CLI-result JSON Schemas as MCP resources.
MCP installation and tool reference