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.88.
Added
Parley
set_dictionary_provideron layout builders, to allow using non-embedded dictionaries for segmentation. (#881 by @DJMcNab)Layout::span_metricsandGlyphRun::span_metrics, exposing the first-available-font metrics of any span, not only the root. (#920 by @conor-93)Layout::primary_caretreturns the line containingbyte_indexand the x-coordinate of the primary caret there. (#939 by @tomcur)
The primary caret is where text in the paragraph's direction would be inserted. Where the text direction changes, this would be the position of a bidi neutral.- A new
CollapsedSpacestyle. Allows whitespace to be collapsed to an ideographic space which is useful for implementingtext-transform: full-width. (#887 by @nicoburns)
Parley Engine
- Breaking change: Added
AnalysisOptions::inline_objects. (#902 by @tomcur)
Inline objects (like images) can now be carried in the text as a U+FFFC OBJECT REPLACEMENT CHARACTER and listed in the analysis options. The soft wrap opportunities of each object can be specified separately. Each such object becomes aShapedClusterof its own; those clusters' advances can be set usingShapedText::set_inline_object_advance. - Breaking change:
AnalysisDataSources, which allows providing non-embedded data for segmentation. This now must be provided inAnalyzer::analyze. (#881 by @DJMcNab) - Breaking change:
Shaper::shape_textnow takes aproduce_safe_to_concat_flagsargument. (#876 by @tomcur)
Whentrue,ShapedCluster::is_safe_to_concat_beforereports whether the text can be changed on one side of the shaped cluster's start. - Breaking change: Added
ShapeOptions::point_size, which is the logical font size, ignoring any scale factor. (#942 by @nicoburns)
It is used for size-dependent shaping, such as tracking from the AATtraktable.ShapeOptions::font_sizeremains the scaled font size. ShapedRunnow stores the font features and the run's script and language the run was shaped with inShapedRun::{features_range, script, language}andShapedText::features. (#879 by @tomcur)
Changed
Parley
-
Breaking change:
Layout::alignhas been removed in favour ofLayout::set_alignment. (#941 by @DJMcNab)
You must now instead useLayout::set_alignmentbefore line breaking:let mut layout = builder.build(...); + layout.set_alignment(Alignment::Center, AlignmentOptions::default()); layout.break_all_lines(Some(max_width)); - layout.align(Alignment::Center, AlignmentOptions::default());
Startalignment is now the default (it was previously implicitlyLeft), so analign(Alignment::Start, AlignmentOptions::default)call can be removed instead. -
Breaking change: In-flow inline boxes are now represented in the text by a U+FFFC OBJECT REPLACEMENT CHARACTER. (#902 by @tomcur)
Using theTreeBuilder, these characters are added automatically. UsingStyleRunBuilderorRangedBuilder, the caller must add them. Each such box becomes its ownlayout::Cluster, so code that walks clusters will see the inline boxes. -
Breaking change:
Layout::inline_boxes_mutwas replaced byLayout::edit_inline_box. (#902 by @tomcur) -
Upgrade to
read-fonts0.46,skrifa0.49,harfrust0.15. (#898 by @nicoburns)
Parley Engine
- Breaking change:
ShapedRunis now marked#[non_exhaustive]. (#879 by @tomcur) - Breaking change:
CharCluster::calculate_coverageno longer takes anAnalysisDataSourcesparameter. (#911 by @tomcur) - Graphemes can now span across
ShapedSliceedges. (#927 by @tomcur)
This is useful if, e.g., a line break falls inside some exotic graphemes (like between a space and a combining mark). See{Atom, ShapedSlice}::{grapheme_continues_before, grapheme_continues_after}andGrapheme::{continues_before, continues_after}.
Fontique
fontiqueno longer uses Fontconfig when targeting OpenHarmony (target_env = "ohos"); the dummy system backend is used instead. (#913 by @springmin)
Removed
Parley Engine
- Breaking change:
ShapedRun::advancehas been removed. (#916 by @tomcur)
You can sumtext.run_slice(i).shaped_clusters().iter().map(|c| c.advance)instead. - Breaking change:
CharacterFlags::newis no longer public. (#915 by @tomcur)
Fixed
Parley
- Parley now correctly handles fonts with descent metrics encoded as a positive value. (#877 by @nicoburns)
Cluster::visual_offsetnow includes the offset caused by shifting throughBreakerState::set_line_x. (#933 by @tomcur)
This also corrects the geometry used and returned byCursor.- Letter spacing no longer applies to some zero-width formatting characters. (#924 by @DJMcNab)
- In-flow inline boxes in bidirectional text are now ordered as neutral characters, following CSS Writing Modes 4 § 2.4.3. (#902 by @tomcur)
- The caret can now be placed on both sides of an in-flow inline box, and selection now spans a box exactly when it covers the box's character. (#902 by @tomcur)
- Contextual shaping now correctly handles the presence of in-flow inline boxes: e.g., Arabic letters no longer join across a box. (#902 by @tomcur)
- In-flow inline boxes added through
RangedBuilderorStyleRunBuilderare now vertically aligned against the style span they are in. Previously, they were always aligned against the root style. (#902 by @tomcur) - Empty text is no longer laid out as a space, fixing, e.g., caret positions on empty text. (#944 by @tomcur)
Note that empty text still gets a line, but it no longer has any runs, soLine::runsis empty for it. - Tracking from the AAT
traktable is now looked up using the logical font size. Previously, it used the scaled font size, giving incorrect tracking when the layout's scale was not 1. (#942 by @nicoburns)
Parley Engine
ShapedCluster::is_safe_to_break_beforeandAtom::is_safe_to_break_beforenow return whether the text can be broken logically before this shaped cluster without reshaping; previously they always returnedfalse. (#876 by @tomcur)
Fontique
- Italic and oblique styles using a variable font's
slntaxis now slant clockwise. Previously, the synthesizedslntvalue had the wrong sign, which would usually leave glyphs upright. (#922 by @tomcur) - Select the correct variable font width and style in synthesis when the axis defaults and declared attributes conflict. (#921 by @tomcur)
FontInfo::stylenow reports oblique angles with the correct sign. (#923 by @tomcur)
New Contributors
- @springmin made their first contribution in #913
Full Changelog: v0.12.0...v0.13.0