Skip to content

Add how-to: Writing your own plug-ins, and a Plug-ins reference - #138

Merged
justvanrossum merged 8 commits into
mainfrom
how-to-writing-plugins
Oct 26, 2026
Merged

justvanrossum merged 8 commits into
mainfrom
how-to-writing-plugins

Conversation

@JeremieHornus

Copy link
Copy Markdown
Collaborator

A quick reference for extending Fontra, in two pages:

How-to › Extending Fontra › Writing your own plug-ins: the two kinds of plug-ins (editor plug-ins in JavaScript, server plug-ins through entry points), how the editor loads a plug-in, a boilerplate sidebar panel to copy, then an undoable edit, a visualization layer and an edit tool, with the Reference font panel, Fontra Hive, fontra-glyphs and fontra-rcjk as examples, and the current limitations.

Reference › Plug-ins: the facts only — plugin.json keys, address rules, loading sequence and console errors, the editor object, the panel / tool / layer contracts, and the entry-point groups.

Jérémie Hornus and others added 8 commits October 25, 2026 15:18
A quick reference for extending Fontra: the two kinds of plug-ins
(editor plug-ins in JavaScript, server plug-ins through entry points),
how the editor loads a plug-in, a boilerplate sidebar panel, an
undoable edit, a visualization layer and an edit tool, with the
Reference font panel, Fontra Hive, fontra-glyphs and fontra-rcjk as
examples, and the current limitations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dooi2T8UfPUkFLghsNJJ6A
- Caching: Fontra dates static files at server start and answers 304,
  so edits under /localplugins/ need a restart or "Disable cache".
- fontra.views is informational only (listed in Server info).
- fontra.webcontent serves a fixed set of file extensions.
- src/fontra/localplugins/ must be created in a fresh checkout.
- zIndex range is 0–700; glyphsBySelectionMode also has `notediting`.
- Note that the open sidebar tab is restored before plug-ins load.
- order 4801, between Draw and Documentation like the listing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nf3n8emopjyVojDEVQHXNN
Information-oriented counterpart of the how-to: plugin.json keys,
address rules and localStorage key, loading sequence and errors,
the editor object, the sidebar panel, edit tool and visualization
layer contracts, and the server entry-point groups. Listed in the
Reference index; the how-to links to it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nf3n8emopjyVojDEVQHXNN
…es yes, github.com and raw no)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxEmy3FvG5zLs8YjwYnVyp
…jsDelivr needs a tag, what fails and how)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxEmy3FvG5zLs8YjwYnVyp
… lower case

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxEmy3FvG5zLs8YjwYnVyp
…ge after tagging

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxEmy3FvG5zLs8YjwYnVyp
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxEmy3FvG5zLs8YjwYnVyp
@justvanrossum
justvanrossum merged commit a100598 into main Oct 26, 2026
2 checks passed
@justvanrossum
justvanrossum deleted the how-to-writing-plugins branch October 26, 2026 08:52
@justvanrossum

Copy link
Copy Markdown
Member

@JeremieHornus, I am not sure why publishing with GH pages is recommended on this page. It is not needed to get a working plugin.

We tested the initial proof of concept from Fatih: https://github.com/fatih-erikli/fontra-plugin-demo. Using the GH path to the repo is enough, in this case fatih-erikli/fontra-plugin-demo. This will automatically make it go via jsDelivr.

This demo now fails for other reasons (it was made before Fontra was bundled with webpack), but from the error you can see that loading the plugin does work: it fails on an import in the start script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants