From ecba7ee5768381e147782d6d73815b152f5c504a Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 12 Sep 2013 13:00:29 +0300 Subject: beta 2013.09.12 11:48 --- metapost/context/base/mp-tool.mpiv | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'metapost/context/base') 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: -- cgit v1.2.3