commit 7195dbb2d5e4b5be7855b28a0c1073dcc40ac03f parent 84a80d7c79e6d318d6b97b2f62bd7e1c914d4fcc Author: Daniel Barlow <dan@telent.net> Date: Tue, 3 Jun 2025 22:13:44 +0100 make road names bigger and print white behind them Diffstat:
| M | pkgs/maps/main.fnl | | | 16 | ++++++++++++++-- |
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/pkgs/maps/main.fnl b/pkgs/maps/main.fnl @@ -157,12 +157,24 @@ 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) (g:rel_move_to 0 3)