summaryrefslogtreecommitdiff
path: root/src/library/font.rs
AgeCommit message (Collapse)Author
2021-06-26Cleanse libraryLaurenz
- Remove doc-comments for Typst functions from library - Reduce number of library source files
2021-06-25Make font take everything as keyword argumentsLaurenz
2021-06-18Remove eat_ prefixLaurenz
2021-06-11Remove props in favor of using state for everythingLaurenz
2021-06-10Text decorationsMartin Haug
2021-05-26Add hash impls for all nodesMartin Haug
This prepares the incremental PR. Co-Authored-By: Laurenz <laurmaedje@gmail.com>
2021-05-23A few predefined colors for testingLaurenz
2021-05-18Leaner argument parsingLaurenz
2021-05-18Rename _new to new and typify to valueLaurenz
2021-04-23Reengineer font and resource loading ๐ŸžLaurenz
2021-03-22Better font family definitions โœ’Laurenz
2021-03-20Square, circle and ellipse ๐Ÿ”ตLaurenz
2021-03-19Text colors ๐Ÿฆฉ (#18)Martin
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
2021-03-19Configurable font edges โš™Laurenz
Adds top-edge and bottom-edge parameters to the font function. These define how the box around a word is computed. The possible values are: - ascender - cap-height (default top edge) - x-height - baseline (default bottom edge) - descender The defaults are chosen so that it's easy to create good-looking designs with vertical alignment. Since they are much tighter than what most other software uses by default, the default leading had to be increased to 50% of the font size and paragraph spacing to 100% of the font size. The values cap-height and x-height fall back to ascender in case they are zero because this value may occur in fonts that don't have glyphs with cap- or x-height (like Twitter Color Emoji). Since cap-height is the default top edge, doing no fallback would break things badly. Removes softness in favor of a simple boolean for pages and a more finegread u8 for spacing. This is needed to make paragraph spacing consume line spacing created by hard line breaks.
2021-03-17Formatting and documentation โœจLaurenz
2021-03-17Switch from name to ratio for font stretch parameter ๐Ÿ“Laurenz
2021-03-10Move around library types ๐ŸššLaurenz
2020-11-25Merge some modules ๐ŸฅžLaurenz
2020-10-19Allow configuration of directions in page and box โ†—Laurenz
2020-10-12Naming and grammar โœ”Laurenz
2020-10-10Refactor text state ๐Ÿ†ŽLaurenz
2020-10-10Switch back to custom geometry types, unified with layout primitives ๐ŸžLaurenz
2020-10-07Evaluation and node-based layouting ๐Ÿš€Laurenz
2020-10-05Tidy up align function ๐ŸงบLaurenz
2020-10-04Small improvements ๐ŸชLaurenz
2020-10-04Better argument parsing ๐Ÿฅ™Laurenz
2020-10-04Style nits ๐ŸŽˆLaurenz
2020-10-04Separate state and constraints ๐ŸงถLaurenz
2020-10-03Int, Float, Relative and Linear values ๐Ÿ‰Laurenz
2020-10-03Update font docs ๐Ÿ“–Laurenz
2020-10-01Generalize layouting primitives ๐Ÿ›คLaurenz
2020-10-01Reorganize ast types ๐Ÿ•Laurenz
2020-10-01Rename table to dict โœLaurenz
2020-09-27Fix for updated fontdock โœ”Laurenz
2020-08-30Format everything with rustfmt! ๐Ÿ’šLaurenz
2020-08-17Tidy up library functions ๐ŸงบLaurenz
2020-08-16Add Value type and replace dyn-nodes with call-exprs ๐Ÿ—Laurenz
- In addition to syntax trees there are now `Value`s, which syntax trees can be evaluated into (e.g. the tree is `5+5` and the value is `10`) - Parsing is completely pure, function calls are not parsed into nodes, but into simple call expressions, which are resolved later - Functions aren't dynamic nodes anymore, but simply functions which receive their arguments as a table and the layouting context - Functions may return any `Value` - Layouting is powered by functions which return the new `Commands` value, which informs the layouting engine what to do - When a function returns a non-`Commands` value, the layouter simply dumps the value into the document in monospace
2020-08-16Remove tuples and objects in favor of tables ๐Ÿ›ขLaurenz
This refactores the parser tests to make them more concise and flexible with regards to spans.
2020-08-14Desugar body into last argument ๐ŸฉLaurenz
2020-08-14Always parse bodies as syntax trees ๐ŸŒณLaurenz
Previously they were passed as strings to the function parser, now they are parsed and then passed as trees to the function. This allows making bodies sugar for a last content argument. While it removes some flexibility allowing function to parse arbitrary syntaxes in their bodies, these can be modelled as (raw) string arguments.
2020-08-04Refactor function parsing โ™ปLaurenz
2020-08-03Formatting, documentation and small improvements ๐ŸงฝLaurenz
2020-08-02Replace body! macro with functions ๐ŸงฐLaurenz
2020-08-02Refactor model into tree ๐Ÿ›’Laurenz
2020-08-02Refactor argument parsing ๐Ÿ”ฌLaurenz
2020-08-02Unify font and page functions ๐Ÿ’•Laurenz
- Removes font weight and width warnings for now, will be added again later - Adds a bit hacky get_first function for tuples, will be refactored soon anyway
2020-08-01Raw lengths ๐ŸšฒLaurenz
Replace unitless length with raw f64 and introduce length type with unit.
2020-08-01Port font handling to fontdock and ttf-parser ๐Ÿ›ณLaurenz
- Use fontdock for indexing fonts and querying - Typst binary now automatically indexes and uses system fonts in addition to a fixed font folder! - Removes subsetting support for now (was half-finished anyways, plan is to use harfbuzz for subsetting in the future) - Adds font width configuration support
2020-07-29Move, rename and switch some things (boring) ๐ŸššLaurenz
- Problems -> Diagnostics - Position -> Pos - offset_spans -> Offset trait - Size -> Length (and some more size types renamed) - Paper into its own module - scope::Parser -> parsing::CallParser - Create `Decorations` alias - Remove lots of double newlines - Switch from f32 to f64