Releases: kas-gui/kas-text
Releases · kas-gui/kas-text
0.7.0
What's Changed
- Add
Direction::AutoRtl
,text_is_rtl
(#80) - Set the default font size to 16px (#80)
Text
API: do not exposeprepare_runs
,required_action
(#81); more tweaks (#84)- Move status tracking and
Env
fields intoText
(#82) - Remove
TextApi
,TextApiExt
andEditableTextApi
traits (#85) - Revise
fonts
module: renameselector::Database
toResolver
, separate outfontdb::Database
, reviseinit
(#87, #88) - Bump MSRV to 1.80.0 (#87)
Full Changelog: 0.6.0...0.7.0
0.6.0
0.5.0
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
tonew_env
,Text::new_multi
toText::new
and
removeText::new_single
. Note: in usage, theEnvironment::wrap
flag
is usually set anyway. Environment
is nowCopy
Text::env
returnsEnvironment
by copy not referenceText::env_mut
replaced withText::set_env
, which sets required actionsEnvironment::dir
renamed todirection
- Enum
Direction
adjusted to include bidi and non-bidi modes. Environment::flags
and its typeEnvFlags
removed.
Environment::wrap: bool
added andDirection
adjusted (see above).
PX_PALIGN
option removed (behaviour is now always enabled).- Parameters
dpp
andpt_size
ofEnvironment
,TextDisplay::prepare_runs
andFormattableText::font_tokens
are replaced with the singledpem
.
Text preparation:
- Add
Action::VAlign
requiring onlyTextDisplay::vertically_align
action - Remove
TextDisplay::prepare
(butTextApi::prepare
remains) TextDisplay::resize_runs
is no longer a public methodTextDisplay::prepare_runs
may callresize_runs
automatically depending
on preparation status- Remove
TextApi::resize_runs
andTextApi::prepare_lines
- All
TextApi
andTextApiExt
methods doing any preparation now do all
required preparation, and avoid unnecessary steps.
Text measurements (#68):
- Add
TextDisplay::bounding_box
andTextApiExt::bounding_box
(#68, #69) - Add
TextDisplay::measure_width
andTextDisplay::vertically_align
- Add
TextApi::measure_width
andTextApi::measure_height
- Remove
TextDisplay::line_is_ltr
andTextApiExt::line_is_ltr
- Add
TextApiExt::text_is_rtl
TextDisplay::line_is_rtl
andTextApiExt::line_is_rtl
now return type
Result<Option<bool>, NotReady>
, returningOk(None)
if text is emptyTextDisplay::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
andface_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
: removeline_runs
(#71) - Replace
highlight_lines
withhighlight_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)