String: Add .is-empty and .character-count properties

Introduce two new properties for string in .slint:
- .is-empty: Checks if a string is empty.
- .character-count: Retrieves the number of grapheme clusters
  https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries

These additions enhance functionality and improve convenience when working with string properties.
This commit is contained in:
Tasuku Suzuki 2024-12-21 23:40:57 +09:00 committed by Simon Hausmann
parent 12fe2bb36d
commit 68b9dfc247
13 changed files with 200 additions and 8 deletions

View file

@ -195,6 +195,8 @@ log = { workspace = true, optional = true }
raw-window-handle-06 = { workspace = true, optional = true }
unicode-segmentation = "1.12.0"
[target.'cfg(not(target_os = "android"))'.dependencies]
# FemtoVG is disabled on android because it doesn't compile without setting RUST_FONTCONFIG_DLOPEN=on
# end even then wouldn't work because it can't load fonts

View file

@ -227,5 +227,6 @@ pub mod re_exports {
pub use once_cell::race::OnceBox;
pub use once_cell::unsync::OnceCell;
pub use pin_weak::rc::PinWeak;
pub use unicode_segmentation::UnicodeSegmentation;
pub use vtable::{self, *};
}