mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-14 05:24:44 +00:00
Envelope: type that draws nothing adds no box next to other content
An envelope around type of only spaces and a rectangle mapped from the union of the rectangle and the type's laid-out box, so the empty type moved and scaled how the rectangle was distorted. Type that draws nothing now adds no box while other content in the envelope has one, in groups and layers and as a clipping path too. When nothing else in the envelope has a box, the type keeps its laid-out box, so an envelope of only empty type keeps its frame, Make with Mesh and Reset with Mesh still work, and Release still gives back the warp shape. This applies to Make with Warp, Make with Mesh, Make with Top Object, Reset with Mesh, Edit Contents and the stroke margins. Type that has not been measured yet keeps its laid-out box as before. The PDF/.ai import's boxes for envelopes with Distort Appearance measure each object as the whole contents measure it, so the margins the import tries match the contents' geometric box. The three import tests that measure type without registering the glyph measure now register it first, so another test registering it while they run no longer changes their result.
This commit is contained in:
@@ -1780,7 +1780,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
|
||||
- **Type drawn as glyph outlines:** under a geometry effect, in EMF and WMF export, in DXF export when it is written as outlines, flattened with Convert All Text to Outlines, and inside an envelope, type keeps its underline and strikethrough, the weight and dashes of its character strokes when it is scaled, and the placement of its gradients and patterns, as the canvas draws it. A group's or layer's own fills and strokes also paint the underline and strikethrough of the type in it.
|
||||
|
||||
- **Envelopes of type map from the glyphs:** an envelope maps point type, area type, type in groups and layers and type used as a clipping path from the bounds of the glyph outlines, underlines and strikethroughs instead of the type's laid-out box (ascent to descent, or the area's frame), with inline graphics counted by their boxes; rotated type and type in perspective map from their outlines as drawn. Make with Mesh, Make with Top Object and Reset with Mesh without Maintain Shape use those bounds. Type that draws nothing keeps its laid-out box, and so does type inside any other object, such as a blend, a repeat or a symbol instance. This is VectorCraft's own rule; envelopes of type made in VectorCraft and in saved files redraw by it. Tests: `crates/engine/src/tests/envelope.rs`, and `tests/envelope_ink.rs` in `vectorcraft-eps`, `vectorcraft-render` and `vectorcraft-effects`. Scores and hours unchanged.
|
||||
- **Envelopes of type map from the glyphs:** an envelope maps point type, area type, type in groups and layers and type used as a clipping path from the bounds of the glyph outlines, underlines and strikethroughs instead of the type's laid-out box (ascent to descent, or the area's frame), with inline graphics counted by their boxes; rotated type and type in perspective map from their outlines as drawn. Make with Mesh, Make with Top Object and Reset with Mesh without Maintain Shape use those bounds. Type that draws nothing, such as type of only spaces, adds no box while other content in the envelope has one, and keeps its laid-out box when nothing else in the envelope has a box. Type inside any other object, such as a blend, a repeat or a symbol instance, keeps its laid-out box. This is VectorCraft's own rule; envelopes of type made in VectorCraft and in saved files redraw by it. Tests: `crates/engine/src/tests/envelope.rs`, and `tests/envelope_ink.rs` in `vectorcraft-eps`, `vectorcraft-render` and `vectorcraft-effects`. Scores and hours unchanged.
|
||||
|
||||
- **Top-object envelopes share each side by control polygon:** each piece of a top object's four sides takes a share of the content's width or height in proportion to the length of its control polygon, spread along the piece by its curve parameter (evenly along a segment without handles), where the sides used to share it out by length. Each corner is the nearest anchor within 47.5% of the bounding box from its box corner that has a handle 0.01 pt long or shorter, or whose tangent unit vectors differ by 0.01 or more in x or y and turn out of the outline, or else the outline's nearest point to that box corner. Envelopes opened from `.ai` files keep the corners the file saves, through moves, rotations and reflections. A side whose pieces, from corner to corner, are all one cubic curve split at anchors (each within 0.02 pt of that curve's piece) follows that curve's parameter instead, so splitting such a side's curve without changing its shape leaves how the side shares out the content as it was (corners found from the outline can still move, as one at the outline's nearest point snaps onto an anchor within 0.5% of its segment's parameter), and a top object whose `.ai` mesh saves each side's curve in pieces draws its contents along the whole curve's parameter, as the drawn art in users' files (used locally, never committed) does. A side only partly made of one curve keeps the polygon shares. These are VectorCraft's own rules; existing top-object envelopes redraw by them, and gradient meshes made from a path keep sides measured by length. Tests: `a_top_object_*`, `a_reflected_top_object_keeps_the_corners_a_file_gives`, `a_split_curve_keeps_the_top_object_patch`, `a_top_object_side_of_many_arcs_stays_on_them`, `a_rounded_rectangle_top_object_stays_close_to_the_identity` and `a_rectangle_top_object_is_the_identity` in `live::tests` (`vectorcraft-doc`), `envelope_top_object_shares_a_side_by_control_polygon_length` and `envelope_top_object_keeps_its_look_when_anchors_are_added` in `vectorcraft-engine`, `a_top_object_envelope_opens_live_with_its_outline` and `a_top_object_whose_top_is_one_curve_split_in_thirds_opens_live` in `vectorcraft-eps`. Scores and hours unchanged.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user