From fb0e358feccc45c7cd642e346d07f4f7f21b484b Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Wed, 3 Nov 2021 01:22:20 +0000 Subject: Don't use Pango by default. Initialising Pango makes up a large portion of the startup time, and we can achieve neater rendering with pure Cairo if we're just drawing circles anyway. Therefore, this commit avoids loading Pango if no options which require it are specified (such as --font-name or --password-character). This reduces startup time with no background image to ~40ms on my machine (2015 MacBook Pro). --- src/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 64e5975..4f20bd7 100644 --- a/src/main.c +++ b/src/main.c @@ -701,6 +701,7 @@ int main(int argc, char *argv[]) break; case 'f': state.window.entry.font_name = optarg; + state.window.entry.use_pango = true; break; case 'F': state.window.entry.font_size = @@ -712,6 +713,7 @@ int main(int argc, char *argv[]) optarg, 4, NULL); + state.window.entry.use_pango = true; break; case 'c': state.command = optarg; @@ -725,6 +727,7 @@ int main(int argc, char *argv[]) break; case 'w': state.window.entry.tight_layout = false; + state.window.entry.use_pango = true; break; case 'H': state.hide_cursor = true; -- cgit v1.2.3