Skip to content

Render: mixed-value text properties collapse to a single value #277

Description

@nathanacurtis

Found while round-tripping the typography fixtures for #260.

Symptom: a text node whose property varies across its character ranges is written as one uniform value, so the mixed state is lost.

testTypography3  variants[0].elements.text.styles.typography.letterSpacing
  baseline:    "Figma mixed"
  round-trip:  0

The reader represents a per-segment value as "Figma mixed". The writer has no way to act on that — it applies a single value to the whole node — so the round-trip reads back a uniform property.

Questions this needs answered before implementing:

  • Should a spec carry per-segment ranges at all, or is "Figma mixed" deliberately lossy? The writer cannot reconstruct segments from a marker alone.
  • If ranges are wanted, that is a schema addition (segment list per text property) and an ADR — the reader would need to emit getStyledTextSegments output.
  • If not, the writer should at minimum skip a "Figma mixed" value rather than coercing it to a number, and the diff harness should treat it as a known-lossy marker instead of a fidelity finding.

Reach: 1 fixture in the current corpus (testTypography3), on letterSpacing. Any per-segment text property can hit it — fontSize, fontName, textDecoration, fills.

Verification: round-trip testTypography3; typography.letterSpacing must not report a fidelity difference.

Part of #208.

Metadata

Metadata

Assignees

No one assigned

    Labels

    generatorspecs-from-figma processing engine

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions