Skip to content

Commit 9a60b06

Browse files
committed
Merge remote-tracking branch 'upstream/main' into font-system-builder
2 parents 01ed232 + 987ff45 commit 9a60b06

39 files changed

+1312
-855
lines changed

CHANGELOG.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,74 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.14.2] - 2025-04-14
9+
10+
### Fixed
11+
12+
- Ensure MSRV of 1.75.0
13+
14+
## [0.14.1] - 2025-04-04
15+
16+
### Added
17+
18+
- Allow font to be stored as `peniko::Font` with `peniko` feature
19+
20+
## [0.14.0] - 2025-03-31
21+
22+
### Added
23+
24+
- Add configurable font fallback lists using `Fallback` trait
25+
- Add letter spacing support in `Attrs`
26+
- Add arbitrary variable font features in `Attrs`
27+
28+
## [0.13.2] - 2025-03-11
29+
30+
### Fixed
31+
32+
- Fix build for Android targets
33+
34+
## [0.13.1] - 2025-03-10
35+
36+
### Fixed
37+
38+
- Fix glyph start+end indices in `Basic` shaping
39+
40+
## [0.13.0] - 2025-03-10
41+
42+
### Added
43+
44+
- Add `Buffer::set_tab_width` function
45+
- Add `AttrsList::spans_iter` and use it in `Buffer::append`
46+
- Add alignment option to `Buffer::set_rich_text`
47+
- Add `SwashCache::get_outline_commands_uncached`
48+
49+
### Fixed
50+
51+
- Fix typo in fallback font name `Noto Sans CJK JP`
52+
- Fix the character index used for getting a glyph attribute in basic shaping
53+
- Avoid debug assertion when handling `Motion::BufferEnd`
54+
- Handle single wrapped line scrolling
55+
- Reduce memory usage and loading time of FontSystem
56+
- Resolve lints
57+
- Use FreeMono as Braille script fallback
58+
- Load fonts prior to setting defaults
59+
60+
### Changed
61+
62+
- Use `smol_str` for family name in `FamilyOwned`
63+
- Optimize `Buffer::set_rich_text` for when the buffer is reconstructed
64+
- Move `ShapeBuffer` to `FontSystem`
65+
- Cache the monospace fallbacks buffer in `FontSystem`
66+
- Apply fallback font to more Unix-like operating systems
67+
- Use hinting for `swash_outline_commands`
68+
- Update swash to `0.2.0` and hook up `std` feature
69+
- Update minimum supported Rust version to `1.75`
70+
- Update default fonts (for COSMIC, users should set their own as desired)
71+
72+
### Removed
73+
74+
- Drop `ShapePlanCache`
75+
876
## [0.12.1] - 2024-06-31
977

1078
### Changed

Cargo.toml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[package]
22
name = "cosmic-text"
33
description = "Pure Rust multi-line text handling"
4-
version = "0.12.1"
4+
version = "0.14.2"
55
authors = ["Jeremy Soller <jeremy@system76.com>"]
66
edition = "2021"
77
license = "MIT OR Apache-2.0"
88
documentation = "https://docs.rs/cosmic-text/latest/cosmic_text/"
99
repository = "https://github.com/pop-os/cosmic-text"
10-
rust-version = "1.65"
10+
rust-version = "1.75"
1111

1212
[dependencies]
1313
bitflags = "2.4.1"
1414
cosmic_undo_2 = { version = "0.2.0", optional = true }
15-
fontdb = { version = "0.16", default-features = false }
15+
fontdb = { version = "0.23", default-features = false }
1616
hashbrown = { version = "0.14.1", optional = true, default-features = false }
1717
libm = { version = "0.2.8", optional = true }
1818
log = "0.4.20"
@@ -22,34 +22,43 @@ rustc-hash = { version = "1.1.0", default-features = false }
2222
rustybuzz = { version = "0.14", default-features = false, features = ["libm"] }
2323
self_cell = "1.0.1"
2424
smol_str = { version = "0.2.2", default-features = false }
25-
swash = { version = "0.1.17", optional = true }
2625
syntect = { version = "5.1.0", optional = true }
2726
sys-locale = { version = "0.3.1", optional = true }
2827
ttf-parser = { version = "0.21", default-features = false }
2928
unicode-linebreak = "0.1.5"
3029
unicode-script = "0.5.5"
3130
unicode-segmentation = "1.10.1"
32-
rayon = { version = "1", optional = true }
31+
32+
[dependencies.swash]
33+
version = "0.2.0"
34+
default-features = false
35+
features = ["render", "scale"]
36+
optional = true
3337

3438
[dependencies.unicode-bidi]
3539
version = "0.3.13"
3640
default-features = false
3741
features = ["hardcoded-data"]
3842

43+
[dependencies.peniko]
44+
version = "0.3.1"
45+
optional = true
46+
3947
[features]
4048
default = ["std", "swash", "fontconfig"]
4149
fontconfig = ["fontdb/fontconfig", "std"]
4250
monospace_fallback = []
4351
no_std = ["rustybuzz/libm", "hashbrown", "dep:libm"]
52+
peniko = ["dep:peniko"]
4453
shape-run-cache = []
4554
std = [
4655
"fontdb/memmap",
4756
"fontdb/std",
4857
"rustybuzz/std",
58+
"swash?/std",
4959
"sys-locale",
5060
"ttf-parser/std",
5161
"unicode-bidi/std",
52-
"rayon"
5362
]
5463
vi = ["modit", "syntect", "cosmic_undo_2"]
5564
wasm-web = ["sys-locale?/js"]

benches/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn layout(c: &mut Criterion) {
2626

2727
let mut run_on_text = |text: &str| {
2828
buffer.lines.clear();
29-
buffer.set_text(&mut fs, text, ct::Attrs::new(), *shape);
29+
buffer.set_text(&mut fs, text, &ct::Attrs::new(), *shape);
3030
buffer.shape_until_scroll(&mut fs, false);
3131
};
3232

0 commit comments

Comments
 (0)