summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-tool.mpiv4
-rw-r--r--metapost/context/fonts/demo-symbols.mp21
-rw-r--r--metapost/context/fonts/demo-symbols.tex21
3 files changed, 45 insertions, 1 deletions
diff --git a/metapost/context/base/mp-tool.mpiv b/metapost/context/base/mp-tool.mpiv
index a39219c67..bb5ae288e 100644
--- a/metapost/context/base/mp-tool.mpiv
+++ b/metapost/context/base/mp-tool.mpiv
@@ -2454,8 +2454,10 @@ def beginglyph(expr unicode, width, height, depth) =
enddef ;
def endglyph =
- currentpicture := currentpicture scaled charscale ;
setbounds currentpicture to (boundingbox unitsquare xscaled charwd yscaled (charht + chardp) shifted (0,-chardp)) ;
+ if known charscale :
+ currentpicture := currentpicture scaled charscale ;
+ fi ;
endfig ;
enddef ;
diff --git a/metapost/context/fonts/demo-symbols.mp b/metapost/context/fonts/demo-symbols.mp
new file mode 100644
index 000000000..822854c94
--- /dev/null
+++ b/metapost/context/fonts/demo-symbols.mp
@@ -0,0 +1,21 @@
+%D \module
+%D [ file=demo-symbols.mp,
+%D version=2013.09.06,
+%D title=\CONTEXT\ \METAPOST\ graphics,
+%D subtitle=demo font,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+passvariable("fontname","demo-symbols") ;
+passvariable("fontversion","1.005") ;
+
+beginglyph(9754,2,4,0) ; % high voltage
+ interim ahlength := 1 ;
+ drawarrow (1,4) -- (0,2) -- (2,3) -- (1,0) withcolor darkred ;
+endglyph ;
+
diff --git a/metapost/context/fonts/demo-symbols.tex b/metapost/context/fonts/demo-symbols.tex
new file mode 100644
index 000000000..e9af4a027
--- /dev/null
+++ b/metapost/context/fonts/demo-symbols.tex
@@ -0,0 +1,21 @@
+\starttext
+
+ \definemetafont[demo-symbols][demo-symbols.mp]
+
+ \startbuffer
+ watch this: {\demo\char"261A} \quad \ruledhbox{\demo\char"261A}
+ \stopbuffer
+
+ \definefont[demo][demo@demo-symbols]
+
+ \getbuffer \blank
+
+ \definefont[demo][demo@demo-symbols at \the\dimexpr3\exheight]
+
+ \getbuffer \blank
+
+ \definefont[demo][demo@demo-symbols at \the\dimexpr4\exheight]
+
+ \getbuffer \blank
+
+\stoptext