git.lucas.co / cce-terminal
terminal emulator
git clone https://git.lucas.co/cce-terminal.git

commite7895ae7ef5046efcc787258a440f46db288dbc5
parent9481cf719d
authorLucas Galante <[email protected]>
date2026-08-13 23:46
deps: drop glyphon, use cce-ui's cosmic-text re-export

cce-ui no longer depends on glyphon (a wgpu text renderer whose wgpu-side API
was unreachable once the Vulkan path replaced it) — it depends on cosmic-text
directly and re-exports it. Everything this crate named as `glyphon::` was a
cosmic-text re-export, so it now goes through `cce_ui::cosmic_text` and needs
no text-library dependency of its own. That also makes it impossible to drift
onto a second cosmic-text version: a FontSystem handed to cce-ui must be the
same type.

No behavior change — cosmic-text is pinned to the version glyphon resolved to
(=0.12.1) and shaping was verified identical glyph-for-glyph.

Co-Authored-By: Claude <[email protected]>

 Cargo.toml  |  1 -
 src/main.rs | 10 +++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 795b271..d3436cf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,5 @@ wayland-client = { version = "0.31", features = ["system"] }
 calloop = "0.13.0"
 libc = "0.2"
 alacritty_terminal = "0.26.0"
-glyphon = "0.8"
 log = "0.4"
 env_logger = "0.11"
diff --git a/src/main.rs b/src/main.rs
index bff01d9..22a51c9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -104,20 +104,20 @@ impl Settings {
 /// documented pattern for measurement), cached across config reloads.
 fn measure_advance(font_family: &str, font_size: f32) -> Option<f32> {
     use std::sync::{Mutex, OnceLock};
-    static FONT_SYSTEM: OnceLock<Mutex<glyphon::FontSystem>> = OnceLock::new();
+    static FONT_SYSTEM: OnceLock<Mutex<cce_ui::cosmic_text::FontSystem>> = OnceLock::new();
     const RUN: usize = 64;
     let fs = FONT_SYSTEM.get_or_init(|| Mutex::new(cce_ui::create_font_system()));
     let mut fs = fs.lock().ok()?;
-    let mut buffer = glyphon::Buffer::new(
+    let mut buffer = cce_ui::cosmic_text::Buffer::new(
         &mut fs,
-        glyphon::Metrics::new(font_size, (font_size * 1.2).ceil()),
+        cce_ui::cosmic_text::Metrics::new(font_size, (font_size * 1.2).ceil()),
     );
     buffer.set_size(&mut fs, None, None);
     buffer.set_text(
         &mut fs,
         &"M".repeat(RUN),
-        glyphon::Attrs::new().family(glyphon::Family::Name(font_family)),
-        glyphon::Shaping::Advanced,
+        cce_ui::cosmic_text::Attrs::new().family(cce_ui::cosmic_text::Family::Name(font_family)),
+        cce_ui::cosmic_text::Shaping::Advanced,
     );
     let advance = buffer.layout_runs().next()?.line_w / RUN as f32;
     (advance.is_finite() && advance > 0.0).then_some(advance)