Files
craft-libs/crates/text/Cargo.toml
T
aiongg 2df33d2f01 Merge remote-tracking branch 'upstream/main' into sync/main-1116
# Conflicts:
#	Cargo.lock
#	crates/audio/src/lib.rs
#	crates/exr/src/decode.rs
#	crates/font-catalog/src/lib.rs
#	crates/ps/src/lib.rs
#	crates/svg/Cargo.toml
#	crates/text/Cargo.toml
#	crates/text/src/lib.rs
#	crates/video/Cargo.toml
#	crates/video/src/lib.rs
2026-11-16 14:23:07 +00:00

195 lines
7.6 KiB
TOML

[package]
name = "craft-text"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
description = "Text processing below the Craft composer: hyphenation with a bundled US English dictionary and patterns, other languages through hypher"
autotests = false
[lib]
# The lib's test target is the crate's one test executable: its trials and, with `screen-testing`, the
# screen tests in tests/it.
harness = false
[lints]
workspace = true
[dependencies]
kurbo = { workspace = true, optional = true }
hypher = { version = "0.1.8", default-features = false, features = ["alloc"], optional = true }
miniz_oxide = { version = "0.8", optional = true }
unicode-general-category = { version = "1.1", optional = true }
unicode-linebreak = { version = "0.1.5", optional = true }
unicode-segmentation = { version = "1.13", optional = true }
icu_segmenter = { version = "2.3", default-features = false, features = ["compiled_data"], optional = true }
unicode-bidi = { version = "0.3.18", optional = true }
unicode-bidi-mirroring = { version = "0.4.0", optional = true }
# `ui`: the canvas text editor, style and character panels and the spelling dialog, on craft-ui.
egui = { workspace = true, optional = true }
craft-ui = { workspace = true, optional = true }
craft-behavior = { workspace = true, optional = true }
craft-theme = { workspace = true, optional = true }
craft-host = { workspace = true, features = ["ui"], optional = true }
craft-keymap = { workspace = true, optional = true }
serde = { workspace = true }
# `find`: Word's wildcards and regular expressions compile to regex's linear-time engine.
regex = { version = "1.13", optional = true }
# The refusal of a regular expression, as a kind the UI words itself (regex reports only text).
regex-syntax = { version = "0.8", optional = true }
# `font-picker`: the character controls open craft-font-manager's picker instead of a plain list.
craft-font-manager = { workspace = true, optional = true }
# `ui`: the spelling dialog's automation fields are JSON (craft-ui does not re-export serde_json).
serde_json = { workspace = true, optional = true }
[dev-dependencies]
unicode-segmentation = "1.13"
craft-ui = { workspace = true, features = ["testing"] }
[[example]]
name = "hyphgen"
required-features = ["generator"]
[features]
positioned = ["dep:kurbo"]
default = ["hyphen", "bidi", "segment"]
# Hyphenation points; English (bundled dictionary and patterns) needs no further feature.
hyphen = ["dep:hypher", "dep:miniz_oxide", "dep:unicode-general-category"]
# Bidirectional text: embedding levels, line reordering and mirroring (UAX #9).
bidi = ["dep:unicode-bidi", "dep:unicode-bidi-mirroring"]
# Find and replace (`find`, and `ui::find` with `ui`): Acrobat's, PowerPoint's and Word's
# matcher. Pulls regex (Word's wildcards and expressions compile to it); apps without a text
# search leave it off.
find = ["dep:regex", "dep:regex-syntax"]
# Spelling: a bundled English word list (SCOWL, deflated) with suggestions; user words from the app.
spell = ["dep:miniz_oxide"]
# The egui parts: `ui::editor` (canvas text editor on craft-ui's IME composer), `ui::style_panel`,
# `ui::character` and `ui::spelling`.
ui = ["dep:egui", "dep:craft-behavior", "dep:craft-ui", "dep:craft-theme", "dep:craft-host", "dep:craft-keymap", "dep:serde_json", "spell"]
# `ui::character` shows craft-font-manager's font picker (stars, recents, previews, filters)
# instead of a plain family list. Pulls the bundled font indexes; apps that only want the panels
# leave it off.
# The screen tests and the stories: the integration binary `it` and the stories registered in craft-ui's registry.
screen-testing = ["ui", "craft-ui/testing"]
font-picker = ["ui", "dep:craft-font-manager", "craft-font-manager/ui"]
# The dictionary writer (`hyphen::dict`) and pattern trainer (`hyphen::patgen`) used by
# examples/hyphgen.rs.
generator = ["hyphen"]
# Line-break opportunities (UAX #14 with kinsoku) and grapheme-cluster emergency breaks; Thai, Lao,
# Khmer and Burmese words need their language feature.
segment = ["dep:unicode-linebreak", "dep:unicode-segmentation"]
# With `thai`, `lao`, `khmer` or `burmese`: find their words with ICU4X's LSTM models instead of its
# dictionaries. Much smaller (for web builds), slower to run, and its words differ slightly.
lstm = ["segment", "icu_segmenter?/lstm"]
# Each feature below adds the data for one more language: for `hyphen`, hypher's patterns (see
# NOTICE for their licenses; Slovak is `slovak-gpl`, outside `all-languages`); for `segment`, ICU4X's word data for Thai, Lao, Khmer and Burmese
# (one shared data set, Unicode License v3).
all-languages = [
"afrikaans",
"albanian",
"assamese",
"belarusian",
"bengali",
"bulgarian",
"burmese",
"catalan",
"croatian",
"czech",
"danish",
"dutch",
"estonian",
"finnish",
"french",
"galician",
"georgian",
"german",
"greek",
"gujarati",
"hindi",
"hungarian",
"icelandic",
"italian",
"kannada",
"khmer",
"kurmanji",
"lao",
"latin",
"lithuanian",
"malayalam",
"marathi",
"mongolian",
"norwegian",
"oriya",
"panjabi",
"polish",
"portuguese",
"russian",
"sanskrit",
"serbian",
"slovenian",
"spanish",
"swedish",
"tamil",
"telugu",
"thai",
"turkish",
"turkmen",
"ukrainian",
]
afrikaans = ["hyphen", "hypher/afrikaans"]
albanian = ["hyphen", "hypher/albanian"]
assamese = ["hyphen", "hypher/assamese"]
belarusian = ["hyphen", "hypher/belarusian"]
bengali = ["hyphen", "hypher/bengali"]
bulgarian = ["hyphen", "hypher/bulgarian"]
catalan = ["hyphen", "hypher/catalan"]
croatian = ["hyphen", "hypher/croatian"]
czech = ["hyphen", "hypher/czech"]
danish = ["hyphen", "hypher/danish"]
dutch = ["hyphen", "hypher/dutch"]
estonian = ["hyphen", "hypher/estonian"]
finnish = ["hyphen", "hypher/finnish"]
french = ["hyphen", "hypher/french"]
galician = ["hyphen", "hypher/galician"]
georgian = ["hyphen", "hypher/georgian"]
german = ["hyphen", "hypher/german"]
greek = ["hyphen", "hypher/greek"]
gujarati = ["hyphen", "hypher/gujarati"]
hindi = ["hyphen", "hypher/hindi"]
hungarian = ["hyphen", "hypher/hungarian"]
icelandic = ["hyphen", "hypher/icelandic"]
italian = ["hyphen", "hypher/italian"]
kannada = ["hyphen", "hypher/kannada"]
kurmanji = ["hyphen", "hypher/kurmanji"]
latin = ["hyphen", "hypher/latin"]
lithuanian = ["hyphen", "hypher/lithuanian"]
malayalam = ["hyphen", "hypher/malayalam"]
marathi = ["hyphen", "hypher/marathi"]
mongolian = ["hyphen", "hypher/mongolian"]
norwegian = ["hyphen", "hypher/norwegian"]
oriya = ["hyphen", "hypher/oriya"]
panjabi = ["hyphen", "hypher/panjabi"]
polish = ["hyphen", "hypher/polish"]
portuguese = ["hyphen", "hypher/portuguese"]
russian = ["hyphen", "hypher/russian"]
sanskrit = ["hyphen", "hypher/sanskrit"]
serbian = ["hyphen", "hypher/serbian"]
# Slovak patterns are under the GPL, version 2 or later (hyph-sk.tex), unlike every other language
# here, so `all-languages` leaves them out. A build that enables this ships GPL-licensed data. Any
# other dependency that enables `hypher/slovak` (hypher's defaults do) embeds them too, through
# feature unification.
slovak-gpl = ["hyphen", "hypher/slovak"]
slovenian = ["hyphen", "hypher/slovenian"]
spanish = ["hyphen", "hypher/spanish"]
swedish = ["hyphen", "hypher/swedish"]
tamil = ["hyphen", "hypher/tamil"]
telugu = ["hyphen", "hypher/telugu"]
turkish = ["hyphen", "hypher/turkish"]
turkmen = ["hyphen", "hypher/turkmen"]
ukrainian = ["hyphen", "hypher/ukrainian"]
burmese = ["segment", "dep:icu_segmenter"]
khmer = ["segment", "dep:icu_segmenter"]
lao = ["segment", "dep:icu_segmenter"]
thai = ["segment", "dep:icu_segmenter"]