Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: kas-gui/kas-text

0.8.1

17 Sep 08:41
11aec98

Choose a tag to compare

What's Changed

  • 0.8.1: fix size of empty lines and some crashes by @dhardy in #102

Full Changelog: 0.8.0...0.8.1

0.8.0

12 Sep 08:19
fbfade6

Choose a tag to compare

Change log

  • Remove raster module (#91)
  • Removed FontLibrary::init and Text::configure (#94)
  • Remove support for harfbuzz_rs and fontdue (#95)
  • Remove trait EditableText (#98)
  • Replace fontdb with fontique, replacing usage of hard-coded font families and removing configuration of font aliases (#93, #94)
  • Revise FontSelector type: make into a small Copy type and embed in Text objects. Replaces usage of pre-resolved FontId, allowing font selection to be delayed until run-breaking and to use inferred script. (#94)
  • Replace field Effect::aux with Effect::e (#99)
  • Support Swash in font library (#91) and use for text analysis (#94)
  • Support font synthesis (#95)
  • Add GlyphRun type, replacing fns Text{,Display}::glyphs{,_with_effects} with runs (#96, #99)
  • Add fn TextDisplay::apply_offset (#98, #100)
  • Fix behaviour of Align::Stretch in some cases (#100)

PRs

  • Add Swash to font store & make accessible; remove raster module by @dhardy in #91
  • Switch from fontdb to fontique by @dhardy in #93
  • Switch to Fontique + Swash by @dhardy in #94
  • Support font synthesis; remove deps harfbuzz-rs & fontdue; update deps by @dhardy in #95
  • Expose positioned glyphs by run by @dhardy in #96
  • Remove trait EditableText, add fn apply_offset, misc by @dhardy in #98
  • Replace Effect::aux with e; merge fns runs, runs_with_effects by @dhardy in #99
  • Fix offset of line bounds and behaviour of Align::Stretch by @dhardy in #100
  • Prepare version 0.8.0 by @dhardy in #101

0.7.0

02 Dec 14:57
c1c0f2a

Choose a tag to compare

What's Changed

  • Add Direction::AutoRtl, text_is_rtl (#80)
  • Set the default font size to 16px (#80)
  • Text API: do not expose prepare_runs, required_action (#81); more tweaks (#84)
  • Move status tracking and Env fields into Text (#82)
  • Remove TextApi, TextApiExt and EditableTextApi traits (#85)
  • Revise fonts module: rename selector::Database to Resolver, separate out fontdb::Database, revise init (#87, #88)
  • Bump MSRV to 1.80.0 (#87)

Full Changelog: 0.6.0...0.7.0

0.6.0

13 Dec 16:08
077f315

Choose a tag to compare

Stabilise support for Generic Associated Types (GATs). This requires Rust 1.65.0, removes the gat feature flag and affects the FormattableText trait. #75

Bump dependency versions: ttf-parser v0.17.1, rustybuzz v0.6.0 (#76), fontdb v0.10.0 (#77).

0.5.0

20 Aug 10:50
e4a66fd

Choose a tag to compare

Error handling (#65):

  • Add NotReady error type
  • Most methods now return Result<T, NotReady> instead of panicking

Text environment (#68):

  • Remove UpdateEnv type
  • Rename Text::new to new_env, Text::new_multi to Text::new and
    remove Text::new_single. Note: in usage, the Environment::wrap flag
    is usually set anyway.
  • Environment is now Copy
  • Text::env returns Environment by copy not reference
  • Text::env_mut replaced with Text::set_env, which sets required actions
  • Environment::dir renamed to direction
  • Enum Direction adjusted to include bidi and non-bidi modes.
  • Environment::flags and its type EnvFlags removed.
    Environment::wrap: bool added and Direction adjusted (see above).
    PX_PALIGN option removed (behaviour is now always enabled).
  • Parameters dpp and pt_size of Environment, TextDisplay::prepare_runs
    and FormattableText::font_tokens are replaced with the single dpem.

Text preparation:

  • Add Action::VAlign requiring only TextDisplay::vertically_align action
  • Remove TextDisplay::prepare (but TextApi::prepare remains)
  • TextDisplay::resize_runs is no longer a public method
  • TextDisplay::prepare_runs may call resize_runs automatically depending
    on preparation status
  • Remove TextApi::resize_runs and TextApi::prepare_lines
  • All TextApi and TextApiExt methods doing any preparation now do all
    required preparation, and avoid unnecessary steps.

Text measurements (#68):

  • Add TextDisplay::bounding_box and TextApiExt::bounding_box (#68, #69)
  • Add TextDisplay::measure_width and TextDisplay::vertically_align
  • Add TextApi::measure_width and TextApi::measure_height
  • Remove TextDisplay::line_is_ltr and TextApiExt::line_is_ltr
  • Add TextApiExt::text_is_rtl
  • TextDisplay::line_is_rtl and TextApiExt::line_is_rtl now return type
    Result<Option<bool>, NotReady>, returning Ok(None) if text is empty
  • TextDisplay::prepare_lines returns the bottom-right corner of the bounding
    box around content instead of the size of content.

Font fallback:

  • FontLibrary::face_for_char and face_for_char_or_first take an extra
    parameter: last_face_id: Option<FaceId>. This allows the font fallback
    mechanism to avoid switching the font unnecessarily. In usage, letters and
    numbers are selected as before while other characters are selected from the
    last font face used if possible, resulting in longer runs being passed to
    the shaper when using fallback fonts.

Misc:

  • CI: test stable and check Clippy lints (#69).
  • Add Range::is_empty
  • Add num_glyphs feature flag (#69)
  • Memory optimisations for TextDisplay: remove line_runs (#71)
  • Replace highlight_lines with highlight_range (#72)
  • Add fonts::any_loaded (#73)

Fixes:

  • Do not add "line gap" before first line. (In practice this is often 0 anyway.)
  • Do not vertically align text too tall for the input bounds.
  • Markdown formatter: use heading level sizes as defined by CSS
  • Fix position of text highlights on vertically aligned text (#67).
  • Fix r_bound for trailing space (#71)

0.4.3

20 Aug 11:40

Choose a tag to compare

  • Revert API-breaking spelling change: Align::CentreAlign::Center