Repository navigation
| Name | Crates.io | Docs |
|---|---|---|
parley |
Crates.io | Docs |
parley_data |
Crates.io | Docs |
parley_emoji |
Crates.io | Docs |
parley_engine |
Crates.io | Docs |
fontique |
Crates.io | Docs |
This release has an MSRV of 1.96.
Highlights
Parley now reshapes lines after line breaking, so that the correct glyphs and kerning are used at each line's edges. Lines are now also allowed to break inside ligatures. For example, when a line breaks inside a ligature like "fi", which is common in Latin fonts, the resulting lines get separate "f" and "i" glyphs. In cursive scripts such as Arabic, letters keep their contextual joining forms across breaks.
Parley Engine now supports reshaping with insertions and substitutions at line edges. This is useful for hyphenation, including where hyphenating changes a word's spelling: for example, the Dutch word "skiën" can become "ski-en" across a break. Parley does not hyphenate yet.
Added
Parley
- Line breaking now reshapes the lines, such that the correct glyphs and kerning are applied across breaks. (#930 by @tomcur)
BreakLines::break_next_with_lengthcan now break at any character boundary. Breaking inside a ligature, for example, will reshape the resulting lines. (#993 by @tomcur)- Added
push_shaping_spliton the layout builders, to allow breaking ligatures at an arbitrary location within the text. (#973 by @DJMcNab) StyleRunBuilder::push_modified_stylehelper method to derive a style from an existing style (#976 by @nicoburns)- For bidirectional text, we now apply UAX #9 L1 bidi reordering after line breaking. (#1000 by @tomcur)
Parley Engine
- Added support for reshaping of lines, including insertions and substitutions at line edges. (#908 by @tomcur, #988 by @tomcur)
Reshaperreshapes glyphs at a line's start and end, e.g., when a line break falls within a ligature or cursive word. AnEditcan be applied at a line's edges, such as inserting a hyphen or replacing characters (e.g., the Dutch "skiën" when broken across a line can be spelled as "ski-en").Reshaper::{measure_start, measure_end}measure how breaking at a position would change the line's advance. UseReshaper::{line, push_line}to form the line and commit it to aReshapedText. - Added a
ShapedCluster::has_internal_soft_wrap_opportunityflag. (#995 by @tomcur) - Added
CharInfo::is_bidi_reset_at_line_end, indicating whether according to UAX #9 L1 the character's bidi level should be reset to the paragraph's when it's part of whitespace that ends the line. (#1000 by @tomcur)
Fontique
- Breaking change: Added
FontInfoOverride::unicode_range, which can be used to limit font matching to specific ranges, like CSS Fonts 4'sunicode-range. (#956 by @tomcur)
UseUnicodeRangeSetto define such a set. - Fontique now has best-effort support for using the system fontconfig for font enumeration on NetBSD, DragonflyBSD, and OpenBSD. (#977 by @nicoburns)
As is already the case on Linux/FreeBSD, this can cause applications built with Fontique to fail to load on those systems iffontconfigis not present. This can be mitigated by enabling thefontconfig-dlopenfeature to do runtime detection offontconfig.
Changed
Parley
-
Breaking change:
InlineBoxKindwas dropped.InlineBoxKind::CustomOutOfFlowhas been replaced by a separateFloatedBox. In CSS parlance, anInlineBoxis now always an "atomic inline". (#940 by @tomcur)
The oldInlineBoxKind::OutOfFlowfunctionality has been replaced byLayout::primary_caret: those out-of-flow boxes used to simply mark an anchor in the text without impacting layout.Layout::primary_caretreturns that position.Layout::inline_boxesnow only yieldsInlineBox; useLayout::floated_boxesforFloatedBox.Floated boxes are no longer part of line output. E.g.,
Line::items()doesn't yield them andRun::indexis now contiguous.BreakerState::append_inline_box_to_linehas been removed. Previously, that call allowed adding height to a line when anInlineBoxKind::CustomOutOfFlowwas reached, though that wasn't intended usage. If you depended on that behavior, consider using a zero-widthInlineBoxinstead. -
Breaking change:
StyleRunBuilder::push_stylenow takes aparent: Option<u16>parameter (#976 by @nicoburns) -
Breaking change:
LayoutContext::style_run_builderno longer has atextparameter. This parameter is now passed toStyleRunBuilder::build/StyleRunBuilder::build_intoinstead. (#976 by @nicoburns) -
Breaking change: Upgraded to icu4x 2.4.x (#986 by @nicoburns)
-
Upgraded to read-fonts 0.47, skrifa 0.50, harfrust 0.16 (#985 by @nicoburns)
-
Lines can now break at all soft wrap opportunities, including inside shaped clusters such as ligatures. (#992, #996 by @tomcur)
Emergency breaks inside shaped clusters before graphemes are also taken, as well as soft wrap opportunities inside graphemes. Lines on either side of breaks inside ligatures get reshaped. -
Letter-spacing no longer applies inside runs of cursive scripts. (#1001 by @DJMcNab)
Parley Engine
CharCluster::calculate_coveragenow acceptsFnMutinstead ofFn. (#961 by @tomcur)- Breaking change:
ShapedRun's andTextRange's range fields are nowcore::range::Rangeinstead ofcore::ops::Range. (#963 by @tomcur) ShapedRunandTextRangeare nowCopy. (#963 by @tomcur)
Fontique
- Breaking change:
Synthesis::variation_settingsnow returns an iterator of(parlance::Tag, f32)instead of a&[(read_fonts::types::Tag, f32)]slice. (#886 by @nicoburns)
Removed
Parley
- Breaking change:
Run::cluster_rangewas removed. There is no direct replacement; let us know if you depended on this API. (#982 by @tomcur)
Fixed
Fontique
Collection::fallback_familiesno longer returns stale results after a call toCollection::clear. (#997 by @tomcur)
This release has an MSRV of 1.88.
Full Changelog: v0.13.0...v0.14.0