summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock1
-rw-r--r--Cargo.toml1
-rw-r--r--src/text.rs7
3 files changed, 2 insertions, 7 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a2cf1c7..bced7b5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -243,7 +243,6 @@ dependencies = [
"anyhow",
"memchr",
"nix",
- "once_cell",
"pangocairo",
"serde",
"serde_json",
diff --git a/Cargo.toml b/Cargo.toml
index 1f332d7..1b9e28a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,6 @@ nix = { version = "0.26", default-features = false, features = ["fs", "poll"] }
wayrs-client = "0.8"
wayrs-utils = { version = "0.4.0-beta.5", features = ["cursor", "shm_alloc", "seats"] }
wayrs-protocols = { version = "0.8", features = ["wlr-layer-shell-unstable-v1", "viewporter", "fractional-scale-v1"] }
-once_cell = "1.17.1"
[profile.release]
lto = "fat"
diff --git a/src/text.rs b/src/text.rs
index 617a60e..dcad438 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -1,17 +1,16 @@
use crate::color::Color;
-use once_cell::sync::Lazy;
use pango::FontDescription;
use pangocairo::{cairo, pango};
use serde::Deserialize;
use std::f64::consts::{FRAC_PI_2, PI, TAU};
thread_local! {
- pub static PANGO_CTX: Lazy<pango::Context> = Lazy::new(|| {
+ pub static PANGO_CTX: pango::Context = {
let context = pango::Context::new();
let fontmap = pangocairo::FontMap::new();
context.set_font_map(Some(&fontmap));
context
- });
+ };
}
#[derive(Clone, Debug, PartialEq)]
@@ -63,8 +62,6 @@ impl ComputedText {
let layout = PANGO_CTX.with(|ctx| pango::Layout::new(ctx));
layout.set_font_description(Some(attr.font));
-
- layout.set_font_description(Some(attr.font));
if attr.markup {
layout.set_markup(&text);
} else {