mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-26 10:47:11 -06:00
M7.3: Area Type Options — rows, columns, gutter, inset, first baseline stored on area type, laid out by the text engine; Type → Area Type Options… dialog prefilled from the selection
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4d1eb16424
commit
f522e6bd3d
@@ -53,7 +53,17 @@ impl Ctx<'_> {
|
||||
|
||||
/// Lay out a text object into text-space glyph outlines (default [`LayoutOptions`]).
|
||||
pub fn layout(db: &FontDb, t: &TextObject) -> TextLayout {
|
||||
layout_with(db, t, &LayoutOptions::default())
|
||||
let a = &t.area;
|
||||
let opts = LayoutOptions {
|
||||
rows: a.rows,
|
||||
columns: a.columns,
|
||||
gutter: a.gutter,
|
||||
inset: a.inset,
|
||||
first_baseline: a.first_baseline,
|
||||
first_baseline_min: a.first_baseline_min,
|
||||
..LayoutOptions::default()
|
||||
};
|
||||
layout_with(db, t, &opts)
|
||||
}
|
||||
|
||||
/// Lay out a text object with explicit options (area type rows/columns, inset, first baseline,
|
||||
|
||||
+2
-14
@@ -23,19 +23,7 @@ pub use fontdb::{FALLBACK_FAMILY, FontDb, FontFace};
|
||||
use kurbo::{BezPath, Point, Rect, Vec2};
|
||||
pub use layout::{layout, layout_with};
|
||||
|
||||
/// Area Type Options "First Baseline" offset.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
pub enum FirstBaseline {
|
||||
/// The tallest glyph ascent touches the frame top (Illustrator's default).
|
||||
#[default]
|
||||
Ascent,
|
||||
CapHeight,
|
||||
XHeight,
|
||||
/// The first line's leading.
|
||||
Leading,
|
||||
/// Exactly `first_baseline_min` below the top.
|
||||
Fixed,
|
||||
}
|
||||
pub use drawcraft_doc::FirstBaseline;
|
||||
|
||||
/// Paragraph composer (Paragraph panel menu).
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
@@ -48,7 +36,7 @@ pub enum Composer {
|
||||
}
|
||||
|
||||
/// Layout parameters that the document model doesn't store per object (Area Type Options,
|
||||
/// composer, OpenType features). [`layout`] uses the defaults.
|
||||
/// composer, OpenType features). [`layout`] takes rows/columns/inset/first baseline from the object.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct LayoutOptions {
|
||||
/// Area type rows and columns (text flows down each column, then across).
|
||||
|
||||
Reference in New Issue
Block a user