Figma's REST API names a text's feature toggles style.opentypeFlags; the
importer looked for openTypeFlags, so features in real files (SF Pro's
SS16 large symbols on an iOS kit's back chevron) were dropped. The old
spelling is still read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
The reference tool's exports draw an image shown smaller than its pixels
as the area average under each device pixel, at its exact (fractional)
position: a 1254 px illustration at 265 px now matches pixel for pixel.
FigCraft sampled it bicubically at pixel centres, aliasing edges and
thin lines. Straight images scaled down along both axes are resampled
onto the device grid (crate::resample) on the canvas and in exports, so
both still agree; others keep the pattern sampling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
The reference tool's exports (and absoluteRenderBounds) take a drop
shadow as far as its blur radius, and leave out a layer without any
visible paint, effect or children. FigCraft framed shadows at three
standard deviations (1.5 x radius) and counted empty placeholders, so a
glass button exported 92 px instead of 76 and an illustration with an
empty 1448 px box exported at that size. Canvas culling keeps the full
reach; only Document::world_export_bounds frames this way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
The reference tool's saved layouts (derivedTextData) keep a pixel line
height's pitch exactly (22.5, 18.4) and round the self-sizing box's
total up to a whole pixel; only Auto and percentage line heights come
out whole. FigCraft rounded every line height, so a 22.5 px paragraph
drifted half a pixel per line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
A design kit's Light/Dark components switch variant through a `Mode`
string variable bound to the variant property. Imports dropped that:
dark screens showed the light variants.
- REST import reads boundVariables.componentProperties (variant, text
and boolean properties) as componentProperties/<name> bindings.
- An opened REST or .fig file settles them: each bound instance shows
the variant the variable names in its mode, outer instances first,
keeping its own overrides and the ones the mains around it make.
- A text reads a property its instance sets even when the variant set
lists it under another id (imported library copies do).
.fig needs craft-libs craft-fig with the RESOLVE_VARIANT mapping (local
commit edcc9d6d3). On a real-world iOS kit file: dark alerts 28%/20% and
the dark keyboard 38% differing pixels -> 2%, 1.4%, 1.7%.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
Checked against renders of a synthetic file (9 scenes, each now under
0.2% differing pixels):
- a layer in a blend mode of its own (Normal included) blends its fills
among themselves only, then lays them over the canvas as one, with or
without effects;
- a pass-through frame's fills blend with the backdrop also when it has
drop or inner shadows (it drew as an isolated layer);
- drop shadows blend among themselves, then lie under the layer as one;
- inner shadows blend with the fills under them by their own mode;
- plus lighter adds premultiplied colours, alpha as source-over.
Found on iOS kit buttons imported from a .fig, which drew mid grey
instead of near white.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
Figma sets a variable font's optical size to the text size (within the
axis), also for a named style; FigCraft keeps the named instance's (SF
Pro's is 28, its display cut), so imported SF Pro text at text sizes
came out about 14% narrower than in Figma. The .fig, paste and REST
imports now carry the size as the text's opsz value, as the .sketch
import already did (shared pass optical_size_follows_text_size).
Rule from the glyph advances Figma saves in derivedTextData, in a
real-world file and in a synthetic one saved from Figma's web app; Figma's
Inter has no optical size axis and keeps its advances at every size.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
* M6: restore full JPEG export chroma
* M6: check the JPEG matte away from the painted edge
* docs: keep the parity header's change level and describe the JPG chroma fix
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Adopt the shared AGENTS.md (RFC-0072) and test rules (RFC-0071)
* Show the supported MCP root flags
* AGENTS.md: correct the repository facts
Add vectordrawable (L4) and collab-net (L6) to the layer list, and name the plug-in SDK that uses unsafe outside the workspace.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The engine draws superscript and subscript (#1868), but nothing in the
interface set them. Details now starts with Position: None, Superscript
or Subscript for the selected text layers, through text.setFeatures
(choosing one clears the other), showing the layers' current position
and none when they differ. Raising a range of characters on its own
needs per-run features and is left for later.
Shift did nothing with the Pencil: the stroke stayed freehand, while the
Line tool and the Pen keep theirs to 45° steps. pencil_add, shared by the
drag and the release, now keeps one straight segment from where the
stroke started to the pointer at the nearest 45° step while Shift is
held (the Marker and Highlighter too); a Shift-click without a move still
draws nothing.
In a right-to-left UI language the rows inside the panels run from the
right as well: the shared Design panel row (right::block), section
headers, tight_end, sub-labels, checkboxes, radios, disclosures and the
selection header, and the layers and pages lists (indent, disclosure,
icon and name from the right, eye and padlock on the left). Names and
rename fields align to their start.
Hand-placed layouts stay written left to right and are mirrored inside
their row with widgets::flip_x / flip_rect, so an English window takes
the same code path unchanged. Inside a control nothing turns round.
A layers list made wider than the panel by a long name (#1904)
mirrors across its whole width, so it starts scrolled to its right
end, where its rows start (stick_to_right, with a scroll state per
direction so a language switch doesn't leave it at the left end).
The Assets panel, version history, Dev Mode's layouts, the colour
picker, the toolbar, the tab bar and the home screen stay left to right.
Gap 5 had two copies of its "Missing" paragraph, left by merges: one
now.
#2468 moved SVG import onto craft_svg::tree::parse, which runs the size,
entity, attribute and nesting checks itself, but left FigCraft's own
scanners (too_wide, too_deep, nesting) and import/budget.rs unused and
import.rs unformatted: main failed cargo fmt, clippy -D warnings and the
svg tests, which still passed budget::Limits to import_within.
The dead code goes; budget_tests use craft-svg's tree::Limits (bytes,
embedded_bytes, embedded_depth) and its error texts, and hostile_tests
check attribute width with craft_svg::guard::too_wide at the default
limits and the nesting refusal at craft-svg's 256 levels.
Publishing keeps the variables its styles bind and where its copies of other libraries' assets came
from; importing files such a copy under that library when the file links it.
* Dependencies: take craft-libs main at 3af2280ee3
Every craft-libs crate in the workspace now comes from one commit,
3af2280ee3434a2c860012df2f440652621c2c81. They were on five revisions:
e11f9d9a, d13ac58a, 976eb51c, e9829954 (craft-update) and fd5e2fef
(craft-web-api and craft-web-host). Cargo.lock now holds one craft-zip
instead of two.
No FigCraft code changes. The new craft-font-store adds cap-primitives
and its dependencies to Cargo.lock.
* Dependencies: drop pin comments the craft-libs move made untrue
craft-update now uses the same craft-libs rev as the other crates, and
craft-window comes from craft-libs main. Remove the comment that says
craft-update is pinned separately and the comment that says craft-window
is pinned to an unmerged branch.
* Tests: look up craft-fig with cargo metadata filtered to the host
The i18n key test finds the craft-fig sources with `cargo metadata
--offline`. Since craft-font-store depends on cap-primitives, the graph
holds winx, which only Windows uses. Without a platform filter, cargo
metadata needs every platform's sources and failed on Linux CI with
"failed to download `winx v0.36.4`". The query now passes
`--filter-platform` with the host triple from `rustc -vV`.
* Dependencies: take craft-libs main at 453b0da782
Every craft-libs crate in the workspace moves from 3af2280ee3 to
craft-libs main at 453b0da782, and craft-sketch moves from ff142b3ad5
to the same commit. Cargo.lock now holds one craft-figma-rest and one
craft-zip instead of two of each; no other package changes.
* Dependencies: drop the design-file pin comment that no longer holds
craft-penpot, listed above the design-file crates, uses the same
craft-zip as craft-fig and craft-figcraft-format, and every craft-libs
crate is now on one rev, so the comment's reason for a separate rev is
removed.
Without a device, a frame taller than the window scrolled its content and then panned whole, taking
fixed and sticky layers off the top. A frame with them now takes the window as its screen.
From review: the asset list follows the layers placed in the tree, so a
smaller tree (maxNodes, or the MCP tool's retry for maxBytes) means a smaller
list, and `truncated.assetsLeftOut` counts the rest; following aliases reports
`truncated.variables` when it stops at its budget with variables still to
read; and a font is checked with figcraft_text::has_family by its trimmed name,
as the missing-fonts list does, so a family stored with outer spaces isn't
taken for installed. A regression test for each fails without its fix.