Commit Graph

13 Commits

Author SHA1 Message Date
Brandon Thomas a6519d8a55 Fonts: use craft-fonts as an optional build input; move the Japanese fonts out
Shippori Mincho (8.7 MB) and its licence leave assets/fonts. Japanese fonts now
come from storytold/craft-fonts when built with CRAFT_FONTS_DIR (never a
Cargo.toml dependency): crates/fonts/build.rs embeds its manifest as
designcraft_fonts::CRAFT_FONTS. Native builds embed all four fonts; wasm32
embeds BIZ UDPGothic Regular only (web size budget).

- UI (egui): the Jpan faces at the end of every family, BIZ UDPGothic first
  (Bold first in the semibold family).
- Documents: FontDb loads them after the bundled fonts, Mincho first, so they
  are the Japanese fallback ahead of system fonts; SVG text gets them too.
- Vertical alternates test runs on every craft-fonts face and skips when
  CRAFT_FONTS is empty; new UI no-tofu test and without-craft-fonts tests.
- FreeBSD CI tests with craft-fonts; release.yml builds every platform with
  CRAFT_FONTS_DIR + CRAFT_FONTS_REQUIRED=1 at a pinned commit, packages carry
  OFL-<family>.txt; NOTICE, ASSETS.md, AGENTS.md/CLAUDE.md, README, ROADMAP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 11:01:35 -04:00
Brandon Thomas 9a50b3f6c5 Fonts: scan macOS's font asset folders (PingFang, Yu Mincho, …)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:05:40 -04:00
japbcoelho 48e409e214 Fonts: installed fonts are found by name whatever ran before
FontDb cataloged the system fonts only when a character needed a fallback
(nothing else calls load_system_fonts), so a document set in an installed
family was composed in Source Sans 3, and font.list and preflight reported
the family missing (#22).

Every lookup by family name now waits for one scan of the font folders per
session, as VectorCraft does since #130: the app starts the scan in the
background at startup, other processes run it on first use. The scan reads
only each file's table directory and name table, and skips folders it has
already read, so a symlink loop can't hang it. has_family counts installed
families. FontDb::with_font_dirs and system_font_dirs let tests use their
own font folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 09:05:40 -04:00
Brandon Thomas 7d721c92eb Fonts: embed Shippori Mincho once, shared by documents and the UI
The UI theme included the 8.7 MB font a second time; it now uses
designcraft_fonts::JAPANESE_FALLBACK (release binary 72 MB -> 63 MB).
The ROADMAP note joins the Interface language entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:32:47 -04:00
midasdf 3ef82f850c i18n: bundle Japanese font fallback and translate vertical controls 2026-10-05 17:32:47 -04:00
Brandon Thomas d84107aaca Never crash: importers (text, IDML, fonts, format, EPUB, images)
An .xlsx cell reference far from the others no longer allocates the whole
range before the cell cap (billions of cells, out of memory), and long
column names can't overflow. IDML import doesn't trust zip part sizes for
up-front allocation and adds header/footer counts saturating. Tagged Text
and IDML export use let-else; the font fallback has a compiled-in last
resort. These crates deny the panicking lints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 12:43:34 -04:00
Brandon Thomas 6b2fa19f00 T: right-to-left text — bidi shaping and line reordering, paragraph direction
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 05:29:56 -04:00
Brandon Thomas 912ed60767 Y: variable font axis values (sliders, instances on demand)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 02:17:50 -04:00
Brandon Thomas bddaaac887 Y: variable fonts — named instances as styles, shaped, drawn and embedded at their axes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 22:01:32 -04:00
Brandon Thomas 5971553d60 H: place SVG (vector PDF export), PSD, BMP, AI — designcraft-images crate
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 10:51:48 -04:00
Brandon Thomas 8e4403af38 M9: parallel composition scales (Copy FaceRef instead of per-glyph Arc clones; BMP coverage bitset; read-locked word cache)
Cold compose of 1M chars on 8+ threads: ~255 ms -> ~38 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 12:41:29 -04:00
Brandon Thomas cc4a8610c2 M6.4: PDF export (krilla) + file.exportPdf
New crate designcraft-pdf (L3): pages or spreads with MediaBox/TrimBox/BleedBox,
parent items with per-page folios, fills (solid + gradient swatches), aligned/dashed
strokes, corner options, opacity/blend, simple drop shadow, clipped images (JPEG
passthrough), and real text: composed glyph runs with embedded font subsets and
Unicode mapping from the story. CMYK as DeviceCMYK, RGB as DeviceRGB, spot swatches
as Separation, [Registration] as /All. Crop/bleed marks and page info. PDF/A-2b via
krilla; PDF/X-4 writes PDF 1.6 (output intent TODO).

Engine command file.exportPdf {path?, pages?, spreads?, bleed?, marks?, standard?,
compressImages?, title?, author?} (base64 when no path), CLI --export out.pdf with
--pdf-options, File > Export PDF... in the UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 11:20:59 -04:00
Brandon Thomas c9dcad1f6e continued work 2026-10-01 09:36:32 -04:00