mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-31 15:49:48 +00:00
These scripts write no spaces between words, so a paragraph was one word that only broke where it overflowed, mid-word (พัฒนาซอ|ฟต์แวร์). breaks::word_breaks finds the word starts inside each run of them with ICU4X's line segmenter (icu_segmenter 2.3, matching the icu_* crates in the lock), and break_lines may break there when the next glyph starts a new cluster. Where a run meets other text the UAX #14 subset decides as before; a word wider than its box keeps #1400's emergency break. Desktop uses the segmenter's dictionaries; the browser uses its LSTM models (about 0.39 MB of wasm instead of 1.86 MB, which the 24 MiB web gate can't take). ICU4X breaks between stray marks are filtered through safe_emergency_break, so junk input never splits a cluster. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LvG6DyK6i9Nvvsp3tp77UP
42 lines
1.9 KiB
TOML
42 lines
1.9 KiB
TOML
[package]
|
|
name = "figcraft-text"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "FigCraft text: font database (embedded craft-fonts + system fonts), shaping, line layout, glyph outlines"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
figcraft-geom = { workspace = true }
|
|
figcraft-doc = { workspace = true }
|
|
skrifa = { workspace = true }
|
|
harfrust = { workspace = true }
|
|
# Colour emoji: sbix/CBDT strikes are PNG images the text layer decodes for the renderer.
|
|
png = { workspace = true }
|
|
unicode-bidi = { workspace = true }
|
|
unicode-segmentation = { workspace = true }
|
|
icu_segmenter = { workspace = true }
|
|
log = { workspace = true }
|
|
|
|
# Fonts that font managers (RightFont, FontBase, Typeface) activate without copying them into a font
|
|
# folder are known only to Core Text. Its safe wrappers list every available font's file (Core Text
|
|
# needs unsafe FFI, which the workspace forbids). 22.0 is the first release whose
|
|
# `get_descriptors` takes ownership of the array correctly (20.x and 21.x leak it on every scan);
|
|
# it brings core-foundation 0.10, core-graphics 0.25 and core-graphics-types 0.2 beside the older
|
|
# versions other crates use. Pinned exactly: review the diff before bumping.
|
|
# The suite's font store folder (fonts installed by any Craft app) is scanned with the system's.
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
craft-font-catalog = { workspace = true }
|
|
|
|
# The browser build finds Thai, Lao, Khmer and Burmese words with ICU4X's LSTM models (~0.3 MB of
|
|
# wasm) instead of its dictionaries (~1.8 MB, which would take the .wasm past the 24 MiB gate in
|
|
# packaging/web/package.sh).
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
icu_segmenter = { workspace = true, features = ["lstm"] }
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
core-text = { version = "=22.0.0", default-features = false, features = ["link"] }
|
|
objc2 = "0.6"
|