Skip to content

mdl: saving a multi-view file gives every view the first view's font #405

Open

Description

@bpowers

Each view in an MDL sketch has its own $... line giving its font and default colors.
The reader merges all views into one diagram and keeps only the first view's line, so saving a multi-view file writes that line on every view.

Example

test/metasd/WRLD3-03/wrld3-03.mdl has 14 views: 3 use $192-192-192,0,|12||-1--1--1|0-0-0|0-0-255|... and 11 use ...|64-64-64|128-128-128|....
After a save, all 14 carry the first view's line, so 11 views change their default colors.
mark2.mdl, the multi-view file the round-trip test uses, has the same line on both views, so the test does not see this.

Why it matters

Cosmetic, but it changes a real model's diagram on every save, and the save gates do not check it.

Fix

The reader already keeps one record per original view, SketchSegmentCompat (that view's coordinate offset), in datamodel.rs and in project_io.proto as View.SketchCompat.Segment.
Add an optional font to it, fill it per view in the reader, and have the writer prefer it over StockFlow.font.
That is one new protobuf field and no change to how views are merged.

Pointers

Activity

  1. added
    engine
    compat
    on Jun 8, 2026
  2. added
    bug
    on Oct 12, 2026
  3. changed the title [-]MDL roundtrip loses per-view font metadata in multi-view models[/-] [+]mdl: saving a multi-view file gives every view the first view's font[/+] on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcompatengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions