Skip to content

v0.14.0

Latest

Choose a tag to compare

@tomcur tomcur released this 02 Dec 20:40
· 7 commits to main since this release
030e8f7
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_length can now break at any character boundary. Breaking inside a ligature, for example, will reshape the resulting lines. (#993 by @tomcur)
  • Added push_shaping_split on the layout builders, to allow breaking ligatures at an arbitrary location within the text. (#973 by @DJMcNab)
  • StyleRunBuilder::push_modified_style helper 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)
    Reshaper reshapes glyphs at a line's start and end, e.g., when a line break falls within a ligature or cursive word. An Edit can 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. Use Reshaper::{line, push_line} to form the line and commit it to a ReshapedText.
  • Added a ShapedCluster::has_internal_soft_wrap_opportunity flag. (#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's unicode-range. (#956 by @tomcur)
    Use UnicodeRangeSet to 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 if fontconfig is not present. This can be mitigated by enabling the fontconfig-dlopen feature to do runtime detection of fontconfig.

Changed

Parley

  • Breaking change: InlineBoxKind was dropped. InlineBoxKind::CustomOutOfFlow has been replaced by a separate FloatedBox. In CSS parlance, an InlineBox is now always an "atomic inline". (#940 by @tomcur)
    The old InlineBoxKind::OutOfFlow functionality has been replaced by Layout::primary_caret: those out-of-flow boxes used to simply mark an anchor in the text without impacting layout. Layout::primary_caret returns that position.

    Layout::inline_boxes now only yields InlineBox; use Layout::floated_boxes for FloatedBox.

    Floated boxes are no longer part of line output. E.g., Line::items() doesn't yield them and Run::index is now contiguous. BreakerState::append_inline_box_to_line has been removed. Previously, that call allowed adding height to a line when an InlineBoxKind::CustomOutOfFlow was reached, though that wasn't intended usage. If you depended on that behavior, consider using a zero-width InlineBox instead.

  • Breaking change: StyleRunBuilder::push_style now takes a parent: Option<u16> parameter (#976 by @nicoburns)

  • Breaking change: LayoutContext::style_run_builder no longer has a text parameter. This parameter is now passed to StyleRunBuilder::build / StyleRunBuilder::build_into instead. (#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_coverage now accepts FnMut instead of Fn. (#961 by @tomcur)
  • Breaking change: ShapedRun's and TextRange's range fields are now core::range::Range instead of core::ops::Range. (#963 by @tomcur)
  • ShapedRun and TextRange are now Copy. (#963 by @tomcur)

Fontique

  • Breaking change: Synthesis::variation_settings now 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_range was removed. There is no direct replacement; let us know if you depended on this API. (#982 by @tomcur)

Fixed

Fontique

  • Collection::fallback_families no longer returns stale results after a call to Collection::clear. (#997 by @tomcur)

This release has an MSRV of 1.88.

Full Changelog: v0.13.0...v0.14.0