Skip to content

Add interactive vector font editor demo#14

Merged
jserv merged 1 commit intomainfrom
font-edit
Feb 22, 2026
Merged

Add interactive vector font editor demo#14
jserv merged 1 commit intomainfrom
font-edit

Conversation

@jserv
Copy link
Contributor

@jserv jserv commented Feb 22, 2026

This implements a glyph editor for built-in vector font data, parsing glyph bytecode (move/line/curve opcodes) into editable structure with zero heap allocations and provides:

  • Interactive canvas with grid, baseline, ascent/descent, and bearing guidelines
  • Color-coded control points (yellow=move, red=line, blue=curve control, green=curve endpoint) with selection highlighting
  • Mouse-based point selection (left-click primary, right-click secondary) via Euclidean hit testing in glyph coordinate space
  • Arrow-key point movement with Shift+arrow for paired control point manipulation in cubic bezier curves
  • Circular undo stack (8 deep) with coalescing for consecutive arrow key moves, so a single undo restores the full movement sequence
  • Clickable ASCII character grid (0x20-0x7E) and Prev/Next navigation
  • Zoom slider (2x-12x) with dynamic canvas origin centering

Canvas rendering pre-computes the coordinate transform origin once per draw function rather than per-point, and a fe_draw_point() helper eliminates the duplicated selection-check pattern across point types.


Summary by cubic

Adds an interactive vector font editor demo to the example app. Edit built‑in glyphs on a canvas with mouse/keyboard, with undo and zoom.

  • New Features

    • Parses glyph bytecode (move/line/curve) into an editable, zero‑heap structure.
    • Canvas with grid, baseline/ascent/descent, and left/right bearing guides.
    • Color‑coded points with left/right‑click selection; arrows move points; Shift+arrows move paired curve controls.
    • 8‑level circular undo with coalescing for arrow key moves.
    • Clickable ASCII grid (0x20–0x7E), Prev/Next navigation, and 2x–12x zoom.
  • Migration

    • Adds Kconfig option DEMO_FONT_EDITOR (default y); enabled in defconfig; depends on DEMO_EXAMPLE, MODULE_INPUT, FEATURE_VECTOR.
    • Run the example app and toggle “Font Editor” to open the window.

Written for commit 634276a. Summary will update on new commits.

cubic-dev-ai[bot]

This comment was marked as resolved.

This implements a glyph editor for built-in vector font data, parsing
glyph bytecode (move/line/curve opcodes) into editable structure with
zero heap allocations and provides:
- Interactive canvas with grid, baseline, ascent/descent, and bearing
  guidelines
- Color-coded control points (yellow=move, red=line, blue=curve
  control, green=curve endpoint) with selection highlighting
- Mouse-based point selection (left-click primary, right-click
  secondary) via Euclidean hit testing in glyph coordinate space
- Arrow-key point movement with Shift+arrow for paired control point
  manipulation in cubic bezier curves
- Circular undo stack (8 deep) with coalescing for consecutive arrow
  key moves, so a single undo restores the full movement sequence
- Clickable ASCII character grid (0x20-0x7E) and Prev/Next navigation
- Zoom slider (2x-12x) with dynamic canvas origin centering

Canvas rendering pre-computes the coordinate transform origin once per
draw function rather than per-point, and a fe_draw_point() helper
eliminates the duplicated selection-check pattern across point types.
@jserv jserv merged commit 0a1c18c into main Feb 22, 2026
11 checks passed
@jserv jserv deleted the font-edit branch February 22, 2026 03:16
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.

1 participant