From 183d1bd54926b061a8e81585944b80fb9ab0f619 Mon Sep 17 00:00:00 2001 From: Peter Kasza Date: Sun, 5 May 2019 11:29:44 +0200 Subject: Add fixed font-size option for indicator This commit adds a new command line option called --font-size to specify a fixed font size in the indicator. The default value for font-size is 0, which means that the text will autoscale. Any other positive value will result in a fixed text size. --- render.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'render.c') diff --git a/render.c b/render.c index 6d65b96..b2b0956 100644 --- a/render.c +++ b/render.c @@ -128,7 +128,11 @@ void render_frame(struct swaylock_surface *surface) { set_color_for_state(cairo, state, &state->args.colors.text); cairo_select_font_face(cairo, state->args.font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); - cairo_set_font_size(cairo, arc_radius / 3.0f); + if (state->args.font_size > 0) { + cairo_set_font_size(cairo, state->args.font_size); + } else { + cairo_set_font_size(cairo, arc_radius / 3.0f); + } switch (state->auth_state) { case AUTH_STATE_VALIDATING: text = "verifying"; -- cgit v1.2.3