From 7195dbb2d5e4b5be7855b28a0c1073dcc40ac03f Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 3 Jun 2025 22:13:44 +0100 Subject: [PATCH] make road names bigger and print white behind them --- pkgs/maps/main.fnl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/maps/main.fnl b/pkgs/maps/main.fnl index 156f60f..3dc0bd4 100644 --- a/pkgs/maps/main.fnl +++ b/pkgs/maps/main.fnl @@ -157,11 +157,23 @@ label.readout { (cairo-roads-path g lines bounds) (g:set_source_rgb 0.2 0.2 0.2) - (g:set_font_size (- road-width 3)) + (g:set_font_size (+ road-width 1)) (each [_ line (pairs lines)] (case line.name - n (let [(x y angle) (label-coords line bounds)] + n (let [(x y angle) (label-coords line bounds) + ext (g:text_extents n) + w ext.width + h ext.height] (when (and x y) + (g:save) + (g:set_line_width h) + (g:set_source_rgb 1 1 1) + (g:move_to (- x 1) (- y 1)) + (g:rotate angle) + (g:rel_line_to (+ w 1) 0) + (g:stroke) + (g:restore) + (g:save) (g:move_to x y) (g:rotate angle)