summaryrefslogtreecommitdiff
path: root/src/layout/shaping.rs
AgeCommit message (Collapse)Author
2021-10-23Introduce page / block / inline levelsLaurenz
2021-10-23Revise block node contractLaurenz
Frames produced by block nodes are now always treated as exactly one per given region and a frame must not be larger than its respective region. Any overflow must be handled internally. This means that stack and grid don't need to search for fitting regions anymore, since the child has already does that for them. This commit further moves stack spacing into a new `SpacingNode`.
2021-10-10Rename `State` to `Style` and move it into its own moduleLaurenz
2021-09-28Allow linear values for text edgesLaurenz
2021-08-24Switch from state to decorations for underline/strikethrough/overlineLaurenz
2021-08-23Kerned PDF outputLaurenz
2021-08-21Prune derivesLaurenz
2021-08-17Library functions behave more imperativelyLaurenz
- Templates scope state changes - State-modifying function operate in place instead of returning a template - Internal template representation contains actual owned nodes instead of a pointer to a syntax tree + an expression map - No more wide calls
2021-07-29Refactor stateLaurenz
2021-07-25Merge font and par state into text stateLaurenz
2021-07-25State-based monospace handlingLaurenz
2021-07-21Main context structLaurenz
2021-07-08Rename Fill to PaintLaurenz
2021-07-08Rename some library argumentsLaurenz
- font - color -> fill - shorthands for families and size - decoration functions - color -> stroke - strength -> thickness - position -> offset - invert offsets: now positive goes downwards just like the rest of typst
2021-06-30Make clippy a bit happierLaurenz
2021-06-30Bump dependenciesLaurenz
2021-06-11Remove props in favor of using state for everythingLaurenz
2021-06-10Text decorationsMartin Haug
2021-05-28Refactored loading and cache architectureLaurenz
2021-05-26Add hash impls for all nodesMartin Haug
This prepares the incremental PR. Co-Authored-By: Laurenz <laurmaedje@gmail.com>
2021-05-17Convert font units to lengths earlierLaurenz
2021-05-17Tidy up layouting codeLaurenz
2021-05-14Remove resource abstraction and handle images nativelyLaurenz
2021-04-23Reengineer font and resource loading 🏞Laurenz
2021-04-21Make frames serializable 📚Laurenz
This also makes serialization support non-optional since it's too much feature-management for too little benefit.
2021-04-07Refactor and comment ♻Laurenz
2021-04-07Do binary search and find the outermost glyph with the text index 🔍Laurenz
Co-Authored-By: Martin <mhaug@live.de>
2021-04-06Deduplicate ttf-parser and rustybuzz face 🥞Laurenz
2021-04-05Reshaping with unsafe-to-break ⚡Laurenz
Co-Authored-By: Martin <mhaug@live.de>
2021-04-03New paragraph layout 🚀Laurenz
The previous paragraph layout algorithm had a couple of flaws: - It always produced line break opportunities between runs although on the textual level there might have been none. - It didn't handle trailing spacing correctly in some cases. - It wouldn't have been easily adaptable to Knuth-Plass style optimal line breaking because it was fundamentally structured first-fit run-by-run. The new paragraph layout algorithm fixes these flaws. It proceeds roughly in the following stages: 1. Collect all text in the paragraph. 2. Compute BiDi embedding levels. 3. Shape all runs, layout all children and store the resulting items in a reusable (possibly even cacheable) `ParLayout`. 3. Iterate over all line breaks in the concatenated text. 4. Construct lightweight `LineLayout` objects for full lines instead of runs. These mostly borrow from the `ParLayout` and only reshape the first and last run if necessary. The design allows to use Harfbuzz's UNSAFE_TO_BREAK mechanism to make reshaping more efficient. The size of a `LineLayout` can be measured without building the line's frame. 5. Build only the selected line's frames and stack them.
2021-03-30Baseline alignment ⏏Laurenz
2021-03-30Refactor ♻Laurenz
2021-03-24Make pdf module top-level 🧱Laurenz
2021-03-24Text shaping 🚀Laurenz
- Shapes text with rustybuzz - Font fallback with family list - Tofus are shown in the first font Co-Authored-By: Martin <mhaug@live.de>
2021-03-22Better font family definitions ✒Laurenz
2021-03-19Text colors 🦩 (#18)Martin
2021-03-19Better debug representations 💻Laurenz
2021-03-19Scheduled maintenance 🔨Laurenz
- New naming scheme - TextNode instead of NodeText - CallExpr instead of ExprCall - ... - Less glob imports - Removes Value::Args variant - Removes prelude - Renames Layouted to Fragment - Moves font into env - Moves shaping into layout - Moves frame into separate module
2020-10-04Refactor and move shaping out of the layout module ⛳Laurenz
2020-10-03Port to kurbo 🎋Laurenz
2020-10-03Rename bold/italic to strong/emph ✏Laurenz
2020-10-03Rename text layouting to shaping ✏Laurenz