Skip to content

artwork glyph editor

Aisjam edited this page Nov 15, 2026 · 1 revision

Development Glyph Editor

Home · Section index

Working manual · 0.0.1-alpha · source snapshot 16 November 2026

Development-only workflows. Do not apply these keyboard/native-dialog instructions to the handheld Art Canvas.

The Glyph workspace TEXT tool (T) authors editable 6×6 or 12×12 labels over existing artwork. Its generated masks use the normal bank and compositor; wording persists in a .ctg.text companion. See text-tool usage.

Art Canvas reads only named-bank B records from the v2 .ctb.editor companion for picker grouping, ordering and initial folding. This is a read-only presentation exception to the development-editor boundary: runtime rendering still uses CTB masks, never editor layouts, SVG associations or development rasterisation settings. Art Canvas folds are local to its current bank session and do not modify the companion.

Linked CTG artwork uses the same active bank document and .ctb.editor sprite SVG associations as bank-slot editing. OPEN does not import masks; SAVE CTG writes a relative bank reference only. Sprite edits and Apply Pixels affect this one bank; reopen other glyphs to see the saved changes. Linked artwork fixes its bank's resolution; use TO BANK before switching working resolutions. Full-composition SVG drafts live beside the CTG as name.ctg.svg; saving a composition under a new name copies that draft, while sprite SVGs stay in the shared bank library. See linked CTG workflow.

These tools belong to src/Editor/glyphEditor. They do not change the main Contour application, its runtime renderer or core file formats. The editor uses the existing collection documents, sprite masks, four-layer composition model, theme roles and animation data. See bank/font architecture and themes for the shared contracts.

Working banks and resolution

In Vector mode, CROPPED under CUTOUTS / INK intersects the selected closed vector with the sprite canvas (0 to its width and height). Geometry outside the canvas is removed, including clipped holes and additive contours; fully outside shapes disappear. Crossing curves become editable outline segments. Colour, frame and layer are retained, and Undo restores the original vector. Open paths must be closed before cropping. Raster masks are updated only through Apply Pixels.

In Vector mode, SCALE VECTOR under TRANSFORM prompts for a positive multiplier (for example 2 or .5). Enter applies it to both dimensions of the selected vector around its bounds centre, including its cutouts and corner radii; Escape cancels. Undo/Redo restores the operation. The canvas size and raster masks stay unchanged until the existing Apply Pixels workflow is used.

The development workspace maintains independent 8x8 and 12x12 banks, normally Glyphs/Default_8.ctb and Glyphs/Default_12.ctb below the content root. The top resolution button switches working documents, masks, selection, zoom and edit histories. These are genuine pixel dimensions, not different display zooms. The initial 12x12 bank is resampled with nearest-neighbour sampling while keeping stable sprite references, glyph compositions, four layers and frame metadata. REGEN 12 explicitly replaces it from the 8x8 bank after confirmation. Subsequent 12x12 edits do not alter the 8x8 bank.

Editor preferences retain the selected resolution, working paths, sprite/glyph view, selection and zoom. Layout sidecars retain stable bank identity, sparse palette placement and SVG associations. Neither editor preference nor vector source data is added to CTB or CTF. Missing or incompatible files report errors; the original bank is not silently overwritten.

Named library banks and sprite names

The right-hand SPRITE LIBRARY groups thumbnails beneath full-width bank headings in Glyph, Sprite and Vector. U - PETSCII is protected: its original character codes, ordering and glyph associations remain unchanged. Custom bank operations cannot rename, move or hide those characters. Existing artwork editing permissions are unchanged.

Use + BANK to create a section and right-click its heading to rename it, collapse it or delete it. Deleting a nonempty section requires confirming a move and choosing a destination; artwork is retained. Drag custom headings to reorder sections. Clicking a heading toggles its saved collapse state.

+ SPRITE opens creation options for a descriptive name, destination section, 8x8/12x12 working document, and empty raster, copied current raster or independent vector content. The current custom section is the default destination; otherwise CUSTOM is used. Independent vectors get their own stable sprite ID and a reserved empty raster component; applying pixels explicitly makes them Raster + Vector. DUPLICATE defaults to the source sprite's section; its creation options still allow choosing another destination. The sprite context menu can copy attached geometry to an independent asset.

Rename a custom sprite using F2, its right-click menu or the selected Name property. Names accept spaces, numbers and punctuation; duplicates are allowed. The Bank property chooses a destination. Properties show the stable ID, raster / vector component type and resolution. Names never become filenames or IDs. Attached raster and SVG components stay in one thumbnail entry.

Ctrl-click toggles individual selections and Shift-click selects a visible range. Drag selected thumbnails to insert within a section or into another section; a focus-coloured marker shows the insertion point. Multi-sprite moves retain relative display order. Ctrl+A selects visible custom sprites, Ctrl+D clears, and Ctrl+Left/Right reorders a selection. Group undo/redo remains Ctrl+Z/Y with library focus. Copy creates new stable IDs and copies SVG associations; cut moves existing IDs when pasted. Hide removes custom placements without destroying masks still referenced by compositions. SHOW restores hidden custom placements.

SEARCH matches display names, bank names, the displayed internal ID, and numeric IDs. Filter results temporarily reveal matches inside collapsed sections. Clearing the search restores the saved collapse states and never changes ordering. Bank-choice menus support scrolling, Up/Down, Enter and Escape.

The version-2 .ctb.editor sidecar retains the document UUID, legacy sparse slots, SVG associations, stable organisational bank IDs, ordered sprite membership, display names, collapse states and independent-vector flags. CTB/CTF and runtime formats are unchanged. Version-1 sidecars and banks without sidecars migrate their custom sprites to CUSTOM, preserving stable IDs and the existing custom order. The original PETSCII section is reconstructed from canonical character order. Each 8x8/12x12 working document retains independent organisation. Save As copies associated sprite and glyph SVG sources with the new document identity.

Organisation is saved in the sidecar when edited; save the bank to persist new sprites and artwork. Keep the CTB, its .editor companion and its SVG directory together when moving the library to another machine. Group snapshots preserve artwork, compositions and editor metadata for undo.

Glyph, Sprite and Vector

The Vector canvas header shows the active point's X/Y coordinates in SVG document units to three decimal places. It updates during dragging, nudging and undo, including nested holes and ellipse handles. An empty point selection shows dashes; with multiple points selected, the readout follows the active point.

The top tabs select GLYPH composition editing, SPRITE monochrome mask editing and VECTOR path editing. Font collections retain their existing font workflow; these development vector controls belong to artwork banks.

Selecting an SVG-associated sprite opens its vector source. SPRITE returns to the original pixel mask. The Vector tab loads that mask's SVG, or creates an empty document if none is associated. From Glyph, Vector first checks for an existing glyph-conversion SVG and reopens it when available.

Raster-to-SVG Boolean union

RASTER>SVG converts the current monochrome mask into one editable compound path. It extracts only exposed unit-cell edges using integer grid coordinates. An edge-following right-turn rule keeps corner-only contacts separate. Pinched walks split at repeated contact vertices into simple contours. Shared interior edges, duplicate vertices and collinear points disappear. There is no rounding, interpolation or automatic corner smoothing.

Disconnected islands and enclosed holes become separate subpaths with even-odd filling. Six adjacent cells become a four-corner rectangle. Ls and stairs become continuous outlines rather than collections of rectangular runs. The resulting geometry round-trips to the original pixel mask exactly.

In Glyph, GLYPH>SVG converts all four layers of every frame, up to the existing 12-frame limit. It uses the shared composition traversal and quarter-tile offsets. Pixels are grouped separately by frame, layer and semantic ink; coincident layers are never unioned together. Even if two semantic inks currently resolve to the same RGB value, their identities remain independent so theme changes stay valid. Empty and hidden layers, names, inks, visibility and lock metadata are retained. Frame names, durations and loop state are retained too.

F< / F> selects the vector frame to edit. Original raster animation remains intact. The vector canvas preserves the source aspect ratio and node dragging snaps to source-pixel boundaries or centres. Glyph vectors are separate files named SVG/glyph_<bank UUID>_<glyph ID>.svg. Returning through Glyph then Vector reloads that file. SVG exports contain frame and layer groups; ordinary SVG viewers display the selected frame. Timing remains metadata rather than browser animation. All frames remain editable when reopened in Contour.

Editing vector geometry

The left sidebar contains drawing, point, corner, transform, Boolean and file controls. POLYLINE creates an open two-point contour; POINT + inserts each click after the selected point and stays active for multiple additions. SELECT picks nodes, including holes and nested islands, directly on the canvas. Drag a node to move it; Shift-drag moves its contour. MOVE picks the whole compound. POINT - removes a node; EDGE - removes a segment; OPEN / CLOSE changes contour closure. RECT and ELLIPSE create primitives. Ellipse handles resize radii; RADII accepts independent horizontal/vertical values. SCALE, ROTATE and DUP retain editable geometry and cutouts.

SNAP EDGES / SNAP CENTRES / SNAP OFF cycles pointer snapping. Alt temporarily disables it. Rasterisation never consults this setting. SNAP GRID is a one-shot edit rounding the selected contour and its children to grid boundaries, with one undo entry. Select a hole to limit the operation to that hole. Ellipses snap centre and radius parameters, preserving rotation, so rotated handles are not necessarily on grid intersections.

FILLET sets a radius; FILLET % sets distance along adjoining edges as a ratio. Tangent distances clamp to half the available edges. INVERSE uses an opposing circular arc to form a recess. CHAMFER accepts two offsets, such as 1 2. Numeric dialogs preview changes; Apply commits once and Cancel restores the original. Self-intersections use the selected fill rule. Malformed or non-finite geometry is rejected.

UNION combines closed shapes in the same frame, layer and colour. SUBTRACT removes the selected closed shape from another shape in the same layer. Additions and differences remain editable and undoable. Automatic raster conversion uses the optimised boundary tracer and leaves no internal pixel edges. HOLES enters the selected compound's child contours; BACK returns to its parent while the complete artwork remains visible. Existing corner tools work on these contours.

Discrete pixel rendering

VECTORS displays the active binary pixel fill with vector path outlines, editable node handles and the optional grid. Outer contours and internal cutouts retain their vector outlines over the raster fill. PIXELS displays the active 8x8 or 12x12 binary cell matrix. Every cell is filled or empty; enlargement uses integer rectangles. Pixel mode has no vector outlines or node handles. The optional grid is display chrome only. Switching views never changes the editable paths.

AREA COVERAGE is the default for new artwork, with a 60% threshold. The percentage field accepts 0 through 100; its - / + buttons update it live in five-point steps. A cell fills when the union of filled geometry occupies at least the chosen fraction of its complete rectangle. At 0%, even zero coverage meets the inclusive threshold; at 100%, the full cell must be covered.

Polygonal coverage integrates horizontal intersections between every vertex, edge crossing and vertical cell boundary. Intersection length is linear between these events, so midpoint integration gives the clipped polygon area without point-sampling bias. Holes, winding rules and overlapping shapes are resolved before measuring area. Curves use the existing shared outline flattening (32 segments per corner, 256 per ellipse). Above 512 outline edges, a bounded fallback integrates exact horizontal overlap on 256 deterministic subrows per cell. Neither calculation uses the preview's antialiasing. Output remains binary. Measured areas are cached while geometry is unchanged, making threshold changes cheap even for complicated artwork.

CENTRE POINT retains half-open edge ties: left/top included, right/bottom excluded. Its Y field offsets only the sampling point, from -0.49 to +0.49 cell heights (default 0). Negative values move up; positive values move down. The same - / + buttons adjust the offset by 0.05. These controls appear only in Centre Point mode; Area Coverage ignores the stored offset entirely. Settings never transform, mirror or correct the editable geometry. Only APPLY PIXELS changes the mask.

The canvas and final 1x/8x previews share the active 8x8 or 12x12 cell matrix used by APPLY PIXELS. The separate resolution comparison previews rasterise the vector independently at 12x12, 24x24 and 48x48, using the same coverage or centre-sampling settings. They are enlarged by 4x, 2x and 1x for comparison and never change the working bank's saved resolution. Display zoom does not affect any rasterisation decision. Layered glyph previews remain frame previews and cannot flatten over a single sprite mask.

Compound SVG paths accept root or per-path evenodd and nonzero fill rules, including multiple M/L/H/V/Z subpaths and implicitly closed filled paths. Separate SVG elements paint over one another; even-odd applies within a compound path. Explicit subtractive cutouts preserve nested islands. See the SVG fill-rule specification.

Non-destructive saving and SVG import

Vector edits save the external SVG, never the original raster. APPLY PIXELS explicitly writes the exact preview mask to the Sprite workspace as one undoable pixel edit, retaining the SVG source. Save the bank to persist that pixel edit. Saving a bank alone no longer applies pending vector edits. Existing shared-mask protection remains in place. Layered glyph conversions disable Apply Pixels.

Sprite SVGs live beside their bank under SVG/, using the bank identity and stable sprite ID. The bank palette shows the actual raster mask with an S association badge, not a replacement vector thumbnail. Colours remain semantic inks in SVG metadata, with current RGB values in ordinary SVG geometry. Monochrome previews use normal mask ink; Contour's compositions assign their existing layer colours. Semantic shadow uses its normal alpha once.

SAVE in the vector sidebar saves the source, EXPORT writes a separate SVG, RENAME creates a new associated filename while keeping the old file, PLACE reassociates a sprite SVG with an existing unassociated ID, and UNLINK removes the association without deleting the file. Rename/place/unlink are disabled for glyph conversions, whose path is tied to their glyph identity.

PASTE SVG, IMPORT SVG and SVG file drops accept the existing bounded plain SVG subset: filled rectangles, circular rounded rectangles, circles, ellipses, polygons and straight M/L/H/V/Z paths. Unsupported transforms, arbitrary curves, groups without editor metadata, gradients, images and effects are rejected atomically. Clipboard import tries SVG MIME types and then SVG text; otherwise export plain SVG from Affinity and import it. Native Affinity clipboard behaviour still depends on the source application's settings.

New files use contour-vector-v4 metadata, retaining compound paths, Boolean additions, frame/layer identity, timing and raster settings including sample offset. V1, V2 and V3 remain readable. V1 retains centre sampling and its original subtraction semantics. No CTB, CTF or runtime file-format changes are introduced.

In SELECT mode (A), hold the left mouse button away from a node and drag a box to select multiple points, including points in internal cutouts and other visible shapes. Selected points use the selection colour. Shift/Ctrl-drag adds to the selection; Shift/Ctrl-click toggles a point. Drag any selected point to move the group, or use arrows (Shift+arrows for larger steps). Delete/Backspace or POINT - removes the selected points in one undo step. A contour with too few remaining nodes is removed. Ellipses retain radius handles: select all four to move their centre or delete the ellipse. Escape cancels a box or clears the point selection. MOVE retains whole-shape dragging.

Double-click an edge between polygon nodes to insert a new point at the nearest grid intersection to the projected click position. This includes closing edges and internal cutouts and supports undo/redo. The new point may move off the original outline to meet the grid.

Vector FLIP H, FLIP V, R90 (clockwise) and R270 (counterclockwise) transform the selected contour and its cutouts about the canvas centre. They retain editable vertices, corner settings and ellipse parameters, with undo. Raster artwork changes only when Apply Pixels is used.

The Sprite 4X / 8X bank actions now create matching editable SVG copies when the source sprite has an attached vector. 4X adds 90/180/270-degree variants; 8X also adds the four horizontally mirrored rotations. Each gets an independent SVG file, stable sprite ID and descriptive suffix in the source's custom bank (or the selected custom bank/CUSTOM for system sprites). The source is retained. Generated variants appear directly after the source sprite in bank order. System sprite variants append to the destination custom bank because their source is in the separate system bank. A missing or unreadable SVG cancels the batch, and library undo/redo covers the whole batch. Save Bank persists the generated raster sprites.

Corner tools (including C, F and Shift+F) apply to all selected polygon points, including points on internal cutouts and across shapes. Preview and cancel affect the entire selection; applying is one undo step. Percentage fillets calculate the radius separately from each corner’s adjoining edges. Ellipse handles are skipped.

Fillet and inverse-fillet tangent distances can reach the full length of the shorter adjoining edge. The percentage tool accepts ratios through 1.0 (100%). Larger radii clamp to that edge limit; neighbouring rounded corners may overlap.

Vector keyboard shortcuts

These shortcuts apply when the vector canvas has focus:

Shortcut Action
V / A Move / select nodes, including holes
P Add points, or begin a polyline when empty
M / E Rectangle / ellipse
C Chamfer
F / Shift+F Fillet / inverse fillet
Ctrl+J Duplicate with a one-unit offset
Ctrl+C / X / V Copy / cut / append SVG geometry
Delete / Backspace Delete picked node, otherwise selected shape
Arrows / Shift+Arrows Nudge one / ten grid pixels
Ctrl+Z / Ctrl+Shift+Z or Ctrl+Y Undo / redo
Ctrl+S Save vector source
Space+drag / + / - Pan / zoom in / zoom out
Escape Cancel dragging or point insertion

Keyboard paste appends uniformly scaled, matching-aspect SVG geometry; the top PASTE SVG button imports a whole document. Ellipse handles control radii; switch to Move to delete an ellipse. Pixel preview blocks geometry-editing keys.

What should be here

Documentation still to add
Annotated current-build screenshots and a recorded controller walkthrough for this topic.

Evidence and verification

Repository sources used for this page:

  • docs/glyph-editor-development.md

This is a documentation/source review, not a new runtime or hardware test. Physical response, screenshots and listening examples still need verification on a recorded build.

Clone this wiki locally