mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
Japanese PDFs and PDF-compatible .ai files often set text in CID fonts with no ToUnicode map, in vertical columns, and in fonts the reader doesn't have. They came in as outlines (or as the wrong characters). - CID fonts without ToUnicode: the character comes from the font's CFF charset through the standard CMaps (hayro's `embed-cmaps`); Kangxi radicals that some generators map to are unified with their ideographs (⿓ → 龍). - A glyph becomes live type only when the installed font draws the same glyph: compared by box with the font of the PDF's PostScript name, or the closest style of its family (a variable font's named instances), whose style the type then takes. Otherwise it keeps its outline. - Vertical columns (WMode 1, glyphs with no horizontal advance) come back as vertical type, letter spacing as tracking; a single upright glyph is vertical type too. Horizontal lines get tracking from the glyph positions the same way. - Text in a font that isn't installed keeps its outlines (what prints), with an editable copy in a substitute font, drawn pink, on a non-printing layer named after the missing fonts (stroke-only glyphs included). - Marked content other than a layer's (spans with actual text, artifacts) no longer ends a line of type: 篳篥・龍笛・笙 came back as three objects when one character was in a span. - Tests in tests_live_text.rs and tests_realtext.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.2 KiB
TOML
39 lines
1.2 KiB
TOML
[package]
|
|
name = "vectorcraft-pdf"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "VectorCraft PDF export and import"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
vectorcraft-geom = { workspace = true }
|
|
vectorcraft-doc = { workspace = true }
|
|
vectorcraft-effects = { workspace = true }
|
|
vectorcraft-brush = { workspace = true }
|
|
vectorcraft-color = { workspace = true }
|
|
vectorcraft-text = { workspace = true }
|
|
skrifa = { workspace = true }
|
|
kurbo = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
flate2 = { workspace = true }
|
|
image = { workspace = true }
|
|
krilla = { workspace = true }
|
|
hayro-syntax = "0.7.2"
|
|
hayro-interpret = { version = "0.7.0", default-features = false, features = ["embed-fonts", "embed-cmaps"] }
|
|
log = { workspace = true }
|
|
smallvec = "1"
|
|
serde = { workspace = true }
|
|
# PDF security (encrypt.rs): pure Rust, MIT OR Apache-2.0, builds for wasm.
|
|
aes = "0.8"
|
|
md-5 = { version = "0.10", default-features = false }
|
|
sha2 = { version = "0.10", default-features = false }
|
|
|
|
[dev-dependencies]
|
|
vectorcraft-testkit = { workspace = true }
|
|
# A variable font built in code (no font file is committed).
|
|
vectorcraft-text = { workspace = true, features = ["test-fonts"] }
|
|
serde_json = { workspace = true }
|