summaryrefslogtreecommitdiff
path: root/metapost/context/base/mp-tool.mpiv
diff options
context:
space:
mode:
Diffstat (limited to 'metapost/context/base/mp-tool.mpiv')
-rw-r--r--metapost/context/base/mp-tool.mpiv16
1 files changed, 16 insertions, 0 deletions
diff --git a/metapost/context/base/mp-tool.mpiv b/metapost/context/base/mp-tool.mpiv
index 7f6972bf2..6003ea75c 100644
--- a/metapost/context/base/mp-tool.mpiv
+++ b/metapost/context/base/mp-tool.mpiv
@@ -2438,6 +2438,22 @@ enddef ;
% )
% enddef ;
+%D New helpers:
+
+def beginglyph(expr unicode, width, height, depth) =
+ beginfig(unicode) ; % the number is irrelevant
+ charcode := unicode ;
+ charwd := width ;
+ charht := height ;
+ chardp := depth ;
+enddef ;
+
+def endglyph =
+ currentpicture := currentpicture scaled charscale ;
+ setbounds currentpicture to (boundingbox unitsquare xscaled charwd yscaled (charht + chardp) shifted (0,-chardp)) ;
+ endfig ;
+enddef ;
+
%D Dimensions have bever been an issue as traditional MP can't make that large
%D pictures, but with double mode we need a catch: