Skip to content

Commit d2ed5a4

Browse files
authored
Merge pull request #152 from varvedesign/codex/pdfcraft-zoom-reconciliation-20261019
Reconcile PdfCraft issues: zoom and text frames
2 parents 5172718 + e4ad395 commit d2ed5a4

59 files changed

Lines changed: 1533 additions & 60 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ update, not for someone reading the commit log.
1212

1313
## [Unreleased]
1414

15+
### Added
16+
17+
- **Text frame background and border** — Give text its own optional backing fill
18+
and border without changing glyph fill or outline. The border can be set to
19+
zero to keep the background with no visible line. The style is saved with
20+
the document; existing text keeps its prior appearance.
21+
1522
### Changed
1623

1724
- **Linux AppImage**: ships bundled WebKitGTK and GTK so it launches on a

‎apps/website/src/components/DownloadRedirect.astro‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const { heading, dest, destLabel } = Astro.props;
2929
<style>
3030
.redirect-page {
3131
max-width: 600px;
32-
margin: 0 auto;
33-
padding: clamp(4rem, 10vh, 8rem) 0;
32+
margin-inline: auto;
33+
padding: var(--space-9) 0;
3434
text-align: center;
3535
}
3636

@@ -40,13 +40,13 @@ const { heading, dest, destLabel } = Astro.props;
4040
font-weight: 700;
4141
font-variation-settings: 'opsz' 144;
4242
letter-spacing: -0.02em;
43-
margin-bottom: 1rem;
43+
margin-bottom: var(--space-5);
4444
color: var(--text-primary);
4545
}
4646

4747
.redirect-page p {
4848
font-size: var(--type-content-body-size);
4949
color: var(--text-secondary);
50-
margin-bottom: 1rem;
50+
margin-bottom: var(--space-5);
5151
}
5252
</style>

‎apps/website/src/pages/features/typography.astro‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ const fontReplacementFaq = {
9393
</p>
9494
</section>
9595

96+
<section class="feature-section feature-callout" aria-labelledby="text-frame-preview-title">
97+
<p class="feature-callout__eyebrow">In development</p>
98+
<h2 id="text-frame-preview-title">Keep text readable over detailed artwork</h2>
99+
<p>
100+
Varve is adding optional background and border styling around a text frame. These controls are separate from glyph fill and outline, so a caption can sit over a busy illustration without changing the letters themselves. The feature is not in a released build yet.
101+
</p>
102+
<div class="feature-callout__links">
103+
<a href={sitePath('/changelog#unreleased')}>Follow release progress</a>
104+
<a href={sitePath('/docs/tools/typography')}>Read the typography workflow</a>
105+
</div>
106+
</section>
107+
96108
<section class="feature-section feature-callout">
97109
<p class="feature-callout__eyebrow">Import with confidence</p>
98110
<h2>Missing fonts are a reviewable decision, not silent damage</h2>

‎apps/website/tests/e2e/font-provider-marketing.spec.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,23 @@ test.describe('Font provider marketing copy', () => {
2121
await expect(featurePage).toContainText('version-pinned Fontsource artifact');
2222
await expect(featurePage).toContainText('requested Fontsource face');
2323
await expect(featurePage).toContainText('requested weight, style, and license');
24+
const textFrameCallout = featurePage.locator('.feature-callout').filter({
25+
hasText: 'Keep text readable over detailed artwork',
26+
});
27+
await expect(textFrameCallout).toContainText('In development');
28+
await expect(textFrameCallout).toContainText('not in a released build yet');
2429
await page.screenshot({
2530
path: test.info().outputPath('typography-fontsource-flow.png'),
2631
fullPage: true,
2732
});
33+
await page.screenshot({
34+
path: test.info().outputPath('typography-text-frame-desktop.png'),
35+
fullPage: true,
36+
});
37+
await page.setViewportSize({ width: 390, height: 844 });
38+
await page.screenshot({
39+
path: test.info().outputPath('typography-text-frame-mobile.png'),
40+
fullPage: true,
41+
});
2842
});
2943
});

‎apps/website/tests/e2e/visual.spec.ts‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,9 @@ test('download page dark', async ({ page }) => {
618618
await dismissAnalyticsBanner(page);
619619
await warmFullPage(page);
620620
await waitForStableDocument(page);
621-
await expect(page.locator('#main-content')).toHaveScreenshot('download-dark.png', {
621+
await expect(page).toHaveScreenshot('download-dark.png', {
622+
fullPage: true,
623+
clip: await articleClip(page, '#main-content'),
622624
maxDiffPixelRatio: 0.02,
623625
});
624626
});
@@ -680,7 +682,17 @@ test('workspaces docs page light', async ({ page }) => {
680682
await expect(page.getByRole('heading', { name: 'Workspaces', exact: true })).toBeVisible();
681683
await dismissAnalyticsBanner(page);
682684
await warmFullPage(page);
683-
await expect(page.locator('#main-content')).toHaveScreenshot('workspaces-docs-light.png', {
685+
await waitForStableDocument(page);
686+
await page.evaluate(async () => {
687+
document.documentElement.style.scrollBehavior = 'auto';
688+
window.scrollTo(0, 0);
689+
await new Promise<void>((resolve) => {
690+
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
691+
});
692+
});
693+
await expect(page).toHaveScreenshot('workspaces-docs-light.png', {
694+
fullPage: true,
695+
clip: await articleClip(page, '#main-content'),
684696
maxDiffPixelRatio: 0.02,
685697
});
686698
});
@@ -804,10 +816,20 @@ test('typography page light', async ({ page }) => {
804816
await waitForImages(page);
805817
await expect(page.getByRole('heading', { name: 'Typography', exact: true })).toBeVisible();
806818
await warmFullPage(page);
819+
await page.evaluate(async () => {
820+
document.documentElement.style.scrollBehavior = 'auto';
821+
window.scrollTo(0, 0);
822+
await new Promise<void>((resolve) => {
823+
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
824+
});
825+
});
807826
// Chromium alternates the document's stitched height by one footer pixel on
808-
// this long route. Keep the typography article as the visual oracle; header
809-
// and footer have their own snapshots and route checks.
810-
await expect(page.locator('#main-content')).toHaveScreenshot('typography-light.png', {
827+
// this long route. Clip the full-page image to the main content's integer
828+
// document bounds so half-pixel layout edges cannot change the image size.
829+
// Header and footer have their own snapshots and route checks.
830+
await expect(page).toHaveScreenshot('typography-light.png', {
831+
fullPage: true,
832+
clip: await articleClip(page, '#main-content'),
811833
maxDiffPixelRatio: 0.02,
812834
});
813835
});
-50.4 KB
Loading
-25.4 KB
Loading
-31.8 KB
Loading

‎crates/varve-bridge/src/lib.rs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ pub struct IpcTextShape {
9494
text_align: String,
9595
#[serde(default, rename = "textAlignVertical")]
9696
text_align_vertical: Option<String>,
97+
#[serde(default, rename = "textFrame")]
98+
text_frame: Option<varve_core::TextFrameStyle>,
9799
x: f64,
98100
y: f64,
99101
w: f64,
@@ -406,6 +408,7 @@ impl IpcShape {
406408
font_style,
407409
text_align,
408410
text_align_vertical,
411+
text_frame,
409412
x,
410413
y,
411414
w,
@@ -432,6 +435,7 @@ impl IpcShape {
432435
font_style,
433436
text_align,
434437
text_align_vertical,
438+
text_frame,
435439
x,
436440
y,
437441
w,
@@ -798,6 +802,10 @@ mod tests {
798802
"y": 0.0,
799803
"w": 240.0,
800804
"h": 120.0,
805+
"textFrame": {
806+
"fill": {"space": "rgb", "r": 250.0, "g": 249.0, "b": 240.0, "a": 255.0},
807+
"border": {"color": {"space": "rgb", "r": 20.0, "g": 30.0, "b": 40.0, "a": 255.0}, "width": 0.0}
808+
},
801809
"letterSpacing": 0.5,
802810
"lineHeight": 1.6,
803811
"textCase": "none",
@@ -827,6 +835,8 @@ mod tests {
827835
assert_eq!(text["listStyle"], "decimal");
828836
assert_eq!(text["richText"], serde_json::json!({ "paragraphs": [] }));
829837
assert_eq!(text["pathTextSettings"]["pathNodeId"], "path-1");
838+
assert_eq!(text["textFrame"]["fill"]["r"], 250.0);
839+
assert_eq!(text["textFrame"]["border"]["width"], 0.0);
830840
}
831841

832842
#[test]

‎crates/varve-core/src/lib.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ pub use expr::evaluate;
2626
pub use geom::{point_to_segment_dist_sq, rect_contains};
2727
pub use scene::{
2828
get_parent, hit_test, walk_nodes, BlendMode, ChannelOffset, CmykFallback, CropRect, Effect,
29-
EngineColor, FillIR, GradientFill, GradientStop, NodeId, SceneNode, Stroke,
29+
EngineColor, FillIR, GradientFill, GradientStop, NodeId, SceneNode, Stroke, TextFrameBorder,
30+
TextFrameStyle,
3031
};
3132
pub use shape::{PathPoint, Shape};
3233

0 commit comments

Comments
 (0)