From 9df8f76b53a63596bdfb523d8972a477e976d6c9 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 3 Sep 2019 08:28:01 +0200 Subject: [PATCH] extra configuration for svg text --- screenshot.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/screenshot.cpp b/screenshot.cpp index 582fea3c..490d8b85 100644 --- a/screenshot.cpp +++ b/screenshot.cpp @@ -99,7 +99,11 @@ EX namespace svg { string font = "Times"; + ld text_width_multiplier = 1/40.; + int min_text = 3; + EX void text(int x, int y, int size, const string& str, bool frame, color_t col, int align) { + if(size < min_text) return; double dfc = (x - current_display->xcenter) * (x - current_display->xcenter) + (y - current_display->ycenter) * (y - current_display->ycenter); @@ -133,7 +137,7 @@ EX namespace svg { if(!uselatex) print(f, "font-family='", font, "' font-size='", coord(size), "' "); print(f, - stylestr(col, frame ? 0x0000000FF : 0, (1<", str2, ""); stopstring(); println(f); @@ -208,6 +212,12 @@ int read_args() { shot::make_svg = true; shot::take(argcs()); } + else if(argis("-svgtwm")) { + shift_arg_formula(svg::text_width_multiplier); + } + else if(argis("-svgmt")) { + shift(); svg::min_text = argi(); + } else return 1; return 0; }