From 7ecbcaaf68d152851591dbb5931a6eb15d155019 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 25 Nov 2019 23:15:50 +0100 Subject: 2019-11-25 17:37:00 --- metapost/context/base/mpiv/mp-lmtx.mpxl | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'metapost/context/base/mpiv/mp-lmtx.mpxl') diff --git a/metapost/context/base/mpiv/mp-lmtx.mpxl b/metapost/context/base/mpiv/mp-lmtx.mpxl index 4a6fde70d..90095d456 100644 --- a/metapost/context/base/mpiv/mp-lmtx.mpxl +++ b/metapost/context/base/mpiv/mp-lmtx.mpxl @@ -19,15 +19,18 @@ if known context_lmtx : endinput ; fi ; boolean context_lmtx ; context_lmtx := true ; presetparameters "text" [ - offset = 0, - strut = "auto", - style = "", - color = "", - text = "", - anchor = "", - format = "", - position = origin, - trace = false, + offset = 0, + strut = "auto", + style = "", + color = "", + text = "", + anchor = "", + format = "", + position = origin, + trace = false, + + background = "color", + backgroundcolor = "gray", ] ; def lmt_text = applyparameters "text" "lmt_do_text" enddef ; @@ -36,13 +39,14 @@ vardef lmt_do_text = image ( pushparameters "text" ; save style, anchor, txt, fmt, strt ; - string style, anchor, txt, fmt, strt ; + string style, anchor, txt, fmt, strt, bgr ; interim textextoffset := getparameter "offset" ; style := getparameter "style" ; anchor := getparameter "anchor" ; strt := getparameter "strut" ; fmt := getparameter "format" ; txt := getparameter "text" ; + bgr := getparameter "background" ; if fmt <> "" : txt := "\formatone{" & fmt & "}{" & txt & "}" fi ; @@ -63,6 +67,9 @@ vardef lmt_do_text = getparameter "position" ) withcolor getparameter "color" ; + if bgr = "color" : + addbackground withcolor getparameter "backgroundcolor" ; + fi ; popparameters ; ) enddef ; -- cgit v1.2.3