mirror of
https://github.com/storytold/AniCraft.git
synced 2026-11-28 17:19:31 +01:00
Both were written against the single-style layout that lived in crates/text/src/lib.rs before ADR 0085 moved layout to styled runs in rich.rs, so their changes to lib.rs, cmds_text.rs and the roadmap conflict and are resolved to main's side here. The commits that follow rebuild the same behaviour on the styled-text layout and carry over their ideas and tests: line breaks found in reading order and never inside a cluster, a face chosen per cluster with its marks, invisible format characters not counted as missing, the fallback family list, and the note that says which characters show as boxes. Kept from the merge as it is: the ADR 0012 paragraph and the unicode-bidi entry, which the next commit replaces with craft-text's bidi module.
This commit is contained in:
commit
afb4826a77
3 files changed
+17
-2
No files matched your search
Generated
+7
@@ -415,6 +415,7 @@ dependencies = [
|
||||
"fontdb",
|
||||
"harfrust",
|
||||
"skrifa",
|
||||
"unicode-bidi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5225,6 +5226,12 @@ version = "2.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-bidi"
|
||||
version = "0.3.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-general-category"
|
||||
version = "1.1.0"
|
||||
|
||||
@@ -14,6 +14,8 @@ fontdb.workspace = true
|
||||
# Shaping (a HarfBuzz port) and outlines/metrics: both already in the tree through egui.
|
||||
harfrust = "0.12"
|
||||
skrifa = { version = "0.44", default-features = false, features = ["std"] }
|
||||
# The Unicode bidi algorithm (UAX #9), for text that mixes right-to-left and left-to-right runs.
|
||||
unicode-bidi = "0.3"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -34,6 +34,12 @@ so neither may depend on which fonts happen to be installed.
|
||||
embedded Inter), shapes with `harfrust` (a HarfBuzz port), reads outlines and metrics with
|
||||
`skrifa`, and breaks lines (paragraphs at line breaks; with a width, greedily at spaces).
|
||||
These crates are already in the dependency tree through egui, so no new licences.
|
||||
Text that mixes directions (Arabic or Hebrew with numbers or Latin words) follows the
|
||||
Unicode bidi algorithm through `unicode-bidi` (MIT OR Apache-2.0): lines are found in
|
||||
reading order, then each line's runs are shaped in their own direction and placed in
|
||||
visual order. Characters the chosen face doesn't have (Arabic in Inter, say) come from the
|
||||
first of `FALLBACK_FAMILIES` that has them, character by character, so the rest of the block
|
||||
keeps its face; any that no face has are counted, and the command says they show as boxes.
|
||||
Bold and italic pick the matching face of the family; there is no synthetic styling.
|
||||
5. **Break Apart** turns a text element into a shape with the same outlines, as Animate's
|
||||
second Break Apart does.
|
||||
@@ -46,8 +52,8 @@ so neither may depend on which fonts happen to be installed.
|
||||
edited, and the user is told.
|
||||
* Text in Animate documents imports onto this model (ADR 0014).
|
||||
* Not yet: per-character styles in one block, vertical text, text along a path, font
|
||||
embedding for export, glyph fallback across
|
||||
fonts for missing characters (missing glyphs draw as the font's "notdef" box).
|
||||
embedding for export, fallback to installed fonts outside the fallback list (a character
|
||||
none of the loaded faces has draws as the font's "notdef" box, and the command says so).
|
||||
|
||||
## Note (2026-11-11): text fields
|
||||
|
||||
|
||||
Reference in new issue
Block a user