mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-13 23:08:09 +00:00
PSD text fill: keep the fix and its tests, drop the proof-only screenshots and example
The Photopea screenshots, their ATTRIBUTION row and the example that made them documented the bug for review; the unit tests in crates/text cover the behaviour, so they are not needed in the tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UHgFEHEsefoQoBParH47JA
This commit is contained in:
1 parent
7bb971f77c
commit
3bab0d4f52
4 files changed
-29
No files matched your search
@@ -50,7 +50,6 @@ The other built-in ICC profiles and the generated LUT looks are produced by code
|
||||
| `docs/brand/` (all files) | ArtCraft name, wordmark and mark | ArtCraft Team | getartcraft.com | Not open source; trademarks of the ArtCraft Team, [`docs/brand/LICENSE-brand.txt`](docs/brand/LICENSE-brand.txt) |
|
||||
| `docs/images/photocraft-*.jpg` | PhotoCraft screenshots | PhotoCraft contributors (UI) | Rendered offscreen with the `snapshot` example | MIT OR Apache-2.0 (UI); the artwork in each is public domain, listed below |
|
||||
| `docs/images/preferences-apply-*.png` | Preferences before and after adding Apply (no artwork) | PhotoCraft contributors | PhotoCraft control-channel capture and offscreen `snapshot` example | MIT OR Apache-2.0 |
|
||||
| `docs/images/psd-text-fill-*.png` | Live text before and after the PSD fill fix | @ragedotdev | Photopea canvas captures of original synthetic text from `crates/io/examples/psd_text_fill.rs`; cropped to the document, with no Photopea UI assets | MIT OR Apache-2.0 |
|
||||
|
||||
Artwork shown in the screenshots (all public domain, via Wikimedia Commons; details in
|
||||
[`docs/images/SOURCES.md`](docs/images/SOURCES.md)):
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
//! Write a small PSD for a live-text edit check in another editor.
|
||||
//! `cargo run -p photocraft-io --example psd_text_fill -- /tmp/text-fill.psd`
|
||||
|
||||
use photocraft_color::{Color, ColorMode, SampleType};
|
||||
use photocraft_doc::text::{CharStyle, TextRun};
|
||||
use photocraft_doc::{Document, Layer, LayerContent, Size, TextLayer};
|
||||
use photocraft_geom::Affine;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let path = std::env::args_os().nth(1).ok_or_else(|| std::io::Error::new(std::io::ErrorKind::InvalidInput, "usage: psd_text_fill <output.psd>"))?;
|
||||
let mut doc = Document::new("Text fill", Size::new(640, 240), ColorMode::Rgb, SampleType::U8);
|
||||
let text = "Editable text";
|
||||
let mut layer = TextLayer {
|
||||
text: text.into(),
|
||||
runs: vec![TextRun {
|
||||
len: text.len(),
|
||||
style: CharStyle { font_family: "Inter".into(), size_pt: 48.0, color: Color::rgb(0.1, 0.2, 0.5), faux_bold: true, ..Default::default() },
|
||||
}],
|
||||
transform: Affine { m: [1.2, 0.0, 0.0, 1.4, 30.0, 150.0] },
|
||||
..Default::default()
|
||||
};
|
||||
layer.sync_summary();
|
||||
photocraft_text::TextEngine::new().render_layer(&mut layer, doc.resolution_dpi, doc.pixel_format());
|
||||
doc.layers.push(Layer::new("Editable text", LayerContent::Text(layer)));
|
||||
let output = photocraft_io::export(&doc, "text-fill.psd", &Default::default())?;
|
||||
std::fs::write(path, output.bytes)?;
|
||||
Ok(())
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Reference in new issue
Block a user