summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/metapost')
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-base.mp2
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-core.mp531
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-form.mp11
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-grid.mp7
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-grph.mp34
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-mlib.mp425
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-page.mp8
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-spec.mp32
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-tool.mp1
-rw-r--r--Master/texmf-dist/metapost/context/font/punkfont-bold.mp4
-rw-r--r--Master/texmf-dist/metapost/context/font/punkfont-boldslanted.mp5
-rw-r--r--Master/texmf-dist/metapost/context/font/punkfont-characters.mp726
-rw-r--r--Master/texmf-dist/metapost/context/font/punkfont-definitions.mp115
-rw-r--r--Master/texmf-dist/metapost/context/font/punkfont-slanted.mp4
-rw-r--r--Master/texmf-dist/metapost/context/font/punkfont.mp865
15 files changed, 1524 insertions, 1246 deletions
diff --git a/Master/texmf-dist/metapost/context/base/mp-base.mp b/Master/texmf-dist/metapost/context/base/mp-base.mp
index d0b3991c856..93cb5e90c8d 100644
--- a/Master/texmf-dist/metapost/context/base/mp-base.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-base.mp
@@ -479,7 +479,7 @@ def label = draw thelabel enddef;
newinternal dotlabeldiam; dotlabeldiam:=3bp;
vardef dotlabel@#(expr s,z) text t_ =
label@#(s,z) t_;
- label@#(s,z);
+% label@#(s,z);
interim linecap:=rounded;
draw z withpen pencircle scaled dotlabeldiam t_;
enddef;
diff --git a/Master/texmf-dist/metapost/context/base/mp-core.mp b/Master/texmf-dist/metapost/context/base/mp-core.mp
index 7c5d5a1c1b1..2ccdad22c24 100644
--- a/Master/texmf-dist/metapost/context/base/mp-core.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-core.mp
@@ -402,19 +402,22 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
set_par_line_height (ph, pd) ;
- numeric par_hang_indent, par_hang_after, par_indent, par_left_skip ;
+ numeric par_hang_indent, par_hang_after, par_indent, par_left_skip, par_right_skip ;
par_hang_indent := rh ;
par_hang_after := ra ;
par_indent := ri ;
par_left_skip := rl ;
+ par_right_skip := rr ;
pair par_start_pos ;
-
+ pair par_stop_pos ;
par_start_pos := llxy[fpos]
if par_indent <0: shifted (-par_indent, 0) fi
if par_left_skip<0: shifted (-par_left_skip,0) fi ;
+ par_stop_pos := lrxy[tpos]
+ if par_right_skip<0: shifted (par_right_skip,0) fi ; % nasty as the endpos can be shifted by rightskip
if wxy[wpos]>0 :
left_skip := rl + xpart llxy[wpos] - xpart llxy[ppos] ;
@@ -430,249 +433,247 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
numeric multi_par_pages ; multi_par_pages := nxy[tpos]-nxy[fpos]+1 ;
- vardef snapped_multi_pos (expr p) =
- if snap_multi_par_tops :
- if abs(ypart p - ypart ulcorner multipar) < par_line_height :
- (xpart p,ypart ulcorner multipar)
- else :
- p
- fi
+ % locals .. why can't i move these outside?
+
+vardef _pmp_set_multipar_ (expr i) =
+ ( (TextAreas[i] leftenlarged -left_skip) rightenlarged (-right_skip
+ if auto_multi_par_hsize : + rw - bbwidth(TextAreas[i]) fi) )
+enddef ;
+
+vardef _pmp_snapped_multi_pos_ (expr p) =
+ if snap_multi_par_tops :
+ if abs(ypart p - ypart ulcorner multipar) < par_line_height :
+ (xpart p,ypart ulcorner multipar)
else :
p
fi
- enddef ;
+ else :
+ p
+ fi
+enddef ;
- % def set_multipar (expr i) =
- % ((TextAreas[i] leftenlarged -left_skip) rightenlarged -right_skip)
- % enddef ;
+vardef _pmp_estimated_par_lines_ (expr h) =
+ round(h/par_line_height)
+enddef ;
- vardef set_multipar (expr i) =
- ( (TextAreas[i] leftenlarged -left_skip) rightenlarged (-right_skip
- if auto_multi_par_hsize : + rw - bbwidth(TextAreas[i]) fi) )
- enddef ;
+vardef _pmp_top_multi_par_(expr p) =
+ (round(_pmp_estimated_par_lines_(bbheight(p)*par_line_height))=round(bbheight(p)))
+enddef ;
- vardef top_multi_par(expr p) =
- (round(estimated_par_lines(bbheight(p)*par_line_height))=round(bbheight(p)))
- enddef ;
+vardef _pmp_multi_par_tsc_(expr p) =
+ if _pmp_top_multi_par_(p) : TopSkipCorrection else : 0 fi
+enddef ;
- vardef multi_par_tsc(expr p) =
- if top_multi_par(p) : TopSkipCorrection else : 0 fi
- enddef ;
+vardef _pmp_estimated_multi_par_height_ (expr n, t) =
+ if round(par_line_height)=0 :
+ 0
+ else :
+ save ok, h ; boolean ok ;
+ numeric h ; h := 0 ;
+ ok := false ;
+ if (nxy[fpos]=RealPageNumber-1) :
+ for i := 1 upto NOfSavedTextAreas :
+ if (InsideSavedTextArea(i,par_start_pos)) :
+ ok := true ;
+ h := h + _pmp_estimated_par_lines_(ypart ulxy[fpos] -
+ ypart llcorner SavedTextAreas[i]) ;
+ elseif ok :
+ h := h + _pmp_estimated_par_lines_(bbheight(SavedTextAreas[i])) ;
+ fi ;
+ endfor ;
+ fi ;
+ if ok :
+ for i := 1 upto n-1 :
+ h := h + _pmp_estimated_par_lines_(bbheight(TextAreas[i])) ;
+ endfor ;
+ else :
+ % already: ok := false ;
+ for i := 1 upto n-1 :
+ if (InsideTextArea(i,par_start_pos)) :
+ ok := true ;
+ h := h + _pmp_estimated_par_lines_(ypart ulxy[fpos] - ypart llcorner TextAreas[i]) ;
+ elseif ok :
+ h := h + _pmp_estimated_par_lines_(bbheight(TextAreas[i])) ;
+ fi ;
+ endfor ;
+ fi ;
+ h
+ fi
+enddef ;
- vardef estimated_par_lines (expr h) =
- round(h/par_line_height)
- enddef ;
+vardef _pmp_left_top_hang_ (expr same_area) =
- vardef estimated_multi_par_height (expr n, t) =
- if round(par_line_height)=0 :
- 0
- else :
- save ok, h ; boolean ok ;
- numeric h ; h := 0 ;
- ok := false ;
- if (nxy[fpos]=RealPageNumber-1) :
- for i := 1 upto NOfSavedTextAreas :
- if (InsideSavedTextArea(i,par_start_pos)) :
- ok := true ;
- h := h + estimated_par_lines(ypart ulxy[fpos] -
- ypart llcorner SavedTextAreas[i]) ;
- elseif ok :
- h := h + estimated_par_lines(bbheight(SavedTextAreas[i])) ;
- fi ;
- endfor ;
- fi ;
- if ok :
- for i := 1 upto n-1 :
- h := h + estimated_par_lines(bbheight(TextAreas[i])) ;
- endfor ;
- else :
- % already: ok := false ;
- for i := 1 upto n-1 :
- if (InsideTextArea(i,par_start_pos)) :
- ok := true ;
- h := h + estimated_par_lines(ypart ulxy[fpos] - ypart llcorner TextAreas[i]) ;
- elseif ok :
- h := h + estimated_par_lines(bbheight(TextAreas[i])) ;
- fi ;
- endfor ;
- fi ;
- h
- fi
- enddef ;
+ par_hang_after := ra + _pmp_estimated_par_lines_(py-fy) ;
- vardef left_top_hang (expr same_area) =
+ if (par_hang_indent>0) and (par_hang_after<0) and obey_multi_par_hang :
+ pair _ul_ ; _ul_ := (xpart ulcorner multipar, ypart _pmp_snapped_multi_pos_(ulxy[fpos]));
+ pair _pa_ ; _pa_ := _ul_ shifted (0,par_hang_after*par_line_height) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_ -TopSkipCorrection,ypart llcorner multipar)) ;
+ if same_area :
+ _pa_ := (xpart _pa_,max(ypart _pa_ -TopSkipCorrection,ypart llxy[tpos])) ;
+ fi ;
+ if obey_multi_par_more and (round(par_line_height)>0) :
+ par_hang_after := min(0,round(par_hang_after +
+ (ypart urxy[fpos]-ypart _pa_)/par_line_height)) ;
+ fi ;
+ (xpart _ul_ + par_hang_indent, ypart lrxy[fpos]) --
+ (xpart _ul_ + par_hang_indent, ypart _pa_) --
+ (xpart ulcorner multipar, ypart _pa_)
+ else :
+ (xpart ulcorner multipar, ypart lrxy[fpos])
+ fi
+enddef ;
- par_hang_after := ra + estimated_par_lines(py-fy) ;
+vardef _pmp_right_top_hang_ (expr same_area) =
- if (par_hang_indent>0) and (par_hang_after<0) and obey_multi_par_hang :
- pair _ul_ ; _ul_ := (xpart ulcorner multipar, ypart snapped_multi_pos(ulxy[fpos]));
- pair _pa_ ; _pa_ := _ul_ shifted (0,par_hang_after*par_line_height) ;
- _pa_ := (xpart _pa_,max(ypart _pa_ -TopSkipCorrection,ypart llcorner multipar)) ;
- if same_area :
- _pa_ := (xpart _pa_,max(ypart _pa_ -TopSkipCorrection,ypart llxy[tpos])) ;
- fi ;
- if obey_multi_par_more and (round(par_line_height)>0) :
- par_hang_after := min(0,round(par_hang_after +
- (ypart urxy[fpos]-ypart _pa_)/par_line_height)) ;
- fi ;
- (xpart _ul_ + par_hang_indent, ypart lrxy[fpos]) --
- (xpart _ul_ + par_hang_indent, ypart _pa_) --
- (xpart ulcorner multipar, ypart _pa_)
- else :
- (xpart ulcorner multipar, ypart lrxy[fpos])
- fi
- enddef ;
+ par_hang_after := ra + _pmp_estimated_par_lines_(py-fy) ;
- vardef right_top_hang (expr same_area) =
+ if (par_hang_indent<0) and (par_hang_after<0) and obey_multi_par_hang :
+ pair _ur_ ; _ur_ := (xpart urcorner multipar, ypart _pmp_snapped_multi_pos_(urxy[fpos])) ;
+ pair _pa_ ; _pa_ := _ur_ shifted (0,par_hang_after*par_line_height) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_ -TopSkipCorrection,ypart llcorner multipar)) ;
+ if same_area :
+ _pa_ := (xpart _pa_,max(ypart _pa_ -TopSkipCorrection,ypart _pmp_snapped_multi_pos_(ulxy[tpos]))) ;
+ fi ;
+ if obey_multi_par_more and (round(par_line_height)>0) :
+ par_hang_after := min(0,round(par_hang_after +
+ (ypart urxy[fpos]-ypart _pa_)/par_line_height)) ;
+ fi ;
+ (xpart urcorner multipar, ypart _pa_) --
+ (xpart _ur_ + par_hang_indent, ypart _pa_) --
+ (xpart _ur_ + par_hang_indent, ypart _pmp_snapped_multi_pos_(urxy[fpos]))
+ else :
+ (xpart urcorner multipar, ypart _pmp_snapped_multi_pos_(urxy[fpos]))
+ fi
+enddef ;
- par_hang_after := ra + estimated_par_lines(py-fy) ;
+vardef _pmp_x_left_top_hang_ (expr i, t) =
+ par_hang_after := min(0,ra + _pmp_estimated_multi_par_height_(i,t)) ;
+ if (par_hang_indent>0) and (par_hang_after<0) :
+ pair _ul_ ; _ul_ := ulcorner multipar ;
+ pair _pa_ ; _pa_ := _ul_ shifted (0,par_hang_after*par_line_height) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart llcorner multipar)) ;
+ if t :
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart llxy[tpos]));
+ fi ;
+ if abs(ypart _pa_-ypart llxy[tpos])<par_line_height :
+ _pa_ := (xpart _pa_,ypart llxy[tpos]);
+ fi ;
+ if abs(ypart _pa_-ypart llcorner multipar)<par_line_height :
+ _pa_ := (xpart _pa_,ypart llcorner multipar);
+ fi ;
+ (xpart _ul_, ypart _pa_) --
+ (xpart _ul_ + par_hang_indent, ypart _pa_) --
+ (xpart _ul_ + par_hang_indent, ypart _ul_)
+ else :
+ ulcorner multipar
+ fi
+enddef ;
- if (par_hang_indent<0) and (par_hang_after<0) and obey_multi_par_hang :
- pair _ur_ ; _ur_ := (xpart urcorner multipar, ypart snapped_multi_pos(urxy[fpos])) ;
- pair _pa_ ; _pa_ := _ur_ shifted (0,par_hang_after*par_line_height) ;
- _pa_ := (xpart _pa_,max(ypart _pa_ -TopSkipCorrection,ypart llcorner multipar)) ;
- if same_area :
- _pa_ := (xpart _pa_,max(ypart _pa_ -TopSkipCorrection,ypart snapped_multi_pos(ulxy[tpos]))) ;
- fi ;
- if obey_multi_par_more and (round(par_line_height)>0) :
- par_hang_after := min(0,round(par_hang_after +
- (ypart urxy[fpos]-ypart _pa_)/par_line_height)) ;
- fi ;
- (xpart urcorner multipar, ypart _pa_) --
- (xpart _ur_ + par_hang_indent, ypart _pa_) --
- (xpart _ur_ + par_hang_indent, ypart snapped_multi_pos(urxy[fpos]))
- else :
- (xpart urcorner multipar, ypart snapped_multi_pos(urxy[fpos]))
- fi
- enddef ;
-
- vardef x_left_top_hang (expr i, t) =
- par_hang_after := min(0,ra + estimated_multi_par_height(i,t)) ;
- if (par_hang_indent>0) and (par_hang_after<0) :
- pair _ul_ ; _ul_ := ulcorner multipar ;
- pair _pa_ ; _pa_ := _ul_ shifted (0,par_hang_after*par_line_height) ;
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart llcorner multipar)) ;
- if t :
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart llxy[tpos]));
- fi ;
- if abs(ypart _pa_-ypart llxy[tpos])<par_line_height :
- _pa_ := (xpart _pa_,ypart llxy[tpos]);
- fi ;
- if abs(ypart _pa_-ypart llcorner multipar)<par_line_height :
- _pa_ := (xpart _pa_,ypart llcorner multipar);
- fi ;
- (xpart _ul_, ypart _pa_) --
- (xpart _ul_ + par_hang_indent, ypart _pa_) --
- (xpart _ul_ + par_hang_indent, ypart _ul_)
- else :
- ulcorner multipar
- fi
- enddef ;
-
- vardef x_right_top_hang (expr i, t) =
- par_hang_after := min(0,ra + estimated_multi_par_height(i,t)) ;
- if (par_hang_indent<0) and (par_hang_after<0) :
- pair _ur_ ; _ur_ := urcorner multipar ;
- pair _pa_ ; _pa_ := _ur_ shifted (0,par_hang_after*par_line_height) ;
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart lrcorner multipar)) ;
- if t :
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart snapped_multi_pos(urxy[tpos]))) ;
- fi ;
- (xpart _ur_ + par_hang_indent, ypart _ur_) --
- (xpart _ur_ + par_hang_indent, ypart _pa_) --
- (xpart _ur_, ypart _pa_)
- else :
- urcorner multipar
- fi
- enddef ;
-
- vardef left_bottom_hang (expr same_area) =
- pair _ll_, _sa_, _pa_ ;
- _sa_ := if same_area : llxy[tpos] else : lrcorner multipar fi ;
- if (par_hang_indent>0) and (par_hang_after>0) and obey_multi_par_hang :
- _ll_ := (xpart ulcorner multipar, ypart snapped_multi_pos(ulxy[fpos])) ;
- _pa_ := _ll_ shifted (0,-par_hang_after*par_line_height) ;
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart llcorner multipar)) ;
- if same_area :
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart _sa_)) ;
- fi ;
- if obey_multi_par_more and (round(par_line_height)>0) :
- par_hang_after := max(0,round(par_hang_after -
- (ypart urxy[fpos]-ypart _pa_)/par_line_height)) ;
- fi ;
- _pa_ --
- (xpart _pa_ + par_hang_indent,ypart _pa_) --
- (xpart _pa_ + par_hang_indent,ypart _sa_)
- else :
- (xpart llcorner multipar, ypart _sa_)
- fi
- enddef ;
-
- vardef right_bottom_hang (expr same_area) =
- pair _lr_, _sa_, _pa_ ;
- _sa_ := if same_area : snapped_multi_pos(ulxy[tpos]) else : lrcorner multipar fi ;
- if (par_hang_indent<0) and (par_hang_after>0) and obey_multi_par_hang :
- _lr_ := (xpart urcorner multipar, ypart snapped_multi_pos(urxy[fpos])) ;
- _pa_ := _lr_ shifted (0,-par_hang_after*par_line_height) ;
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart lrcorner multipar)) ;
- if same_area :
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart snapped_multi_pos(ulxy[tpos]))) ;
- fi ;
- if obey_multi_par_more and (round(par_line_height)>0) :
- par_hang_after := max(0,round(par_hang_after -
- (ypart urxy[fpos]-ypart _pa_)/par_line_height)) ;
- fi ;
+vardef _pmp_x_right_top_hang_ (expr i, t) =
+ par_hang_after := min(0,ra + _pmp_estimated_multi_par_height_(i,t)) ;
+ if (par_hang_indent<0) and (par_hang_after<0) :
+ pair _ur_ ; _ur_ := urcorner multipar ;
+ pair _pa_ ; _pa_ := _ur_ shifted (0,par_hang_after*par_line_height) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart lrcorner multipar)) ;
+ if t :
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart _pmp_snapped_multi_pos_(urxy[tpos]))) ;
+ fi ;
+ (xpart _ur_ + par_hang_indent, ypart _ur_) --
+ (xpart _ur_ + par_hang_indent, ypart _pa_) --
+ (xpart _ur_, ypart _pa_)
+ else :
+ urcorner multipar
+ fi
+enddef ;
+
+vardef _pmp_left_bottom_hang_ (expr same_area) =
+ pair _ll_, _sa_, _pa_ ;
+ _sa_ := if same_area : llxy[tpos] else : lrcorner multipar fi ;
+ if (par_hang_indent>0) and (par_hang_after>0) and obey_multi_par_hang :
+ _ll_ := (xpart ulcorner multipar, ypart _pmp_snapped_multi_pos_(ulxy[fpos])) ;
+ _pa_ := _ll_ shifted (0,-par_hang_after*par_line_height) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart llcorner multipar)) ;
+ if same_area :
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart _sa_)) ;
+ fi ;
+ if obey_multi_par_more and (round(par_line_height)>0) :
+ par_hang_after := max(0,round(par_hang_after -
+ (ypart urxy[fpos]-ypart _pa_)/par_line_height)) ;
+ fi ;
+ _pa_ --
+ (xpart _pa_ + par_hang_indent,ypart _pa_) --
+ (xpart _pa_ + par_hang_indent,ypart _sa_)
+ else :
+ (xpart llcorner multipar, ypart _sa_)
+ fi
+enddef ;
+
+vardef _pmp_right_bottom_hang_ (expr same_area) =
+ pair _lr_, _sa_, _pa_ ;
+ _sa_ := if same_area : _pmp_snapped_multi_pos_(ulxy[tpos]) else : lrcorner multipar fi ;
+ if (par_hang_indent<0) and (par_hang_after>0) and obey_multi_par_hang :
+ _lr_ := (xpart urcorner multipar, ypart _pmp_snapped_multi_pos_(urxy[fpos])) ;
+ _pa_ := _lr_ shifted (0,-par_hang_after*par_line_height) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart lrcorner multipar)) ;
+ if same_area :
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart _pmp_snapped_multi_pos_(ulxy[tpos]))) ;
+ fi ;
+ if obey_multi_par_more and (round(par_line_height)>0) :
+ par_hang_after := max(0,round(par_hang_after -
+ (ypart urxy[fpos]-ypart _pa_)/par_line_height)) ;
+ fi ;
+ (xpart _pa_ + par_hang_indent,ypart _sa_) --
+ (xpart _pa_ + par_hang_indent,ypart _pa_) --
+ _pa_
+ else :
+ (xpart lrcorner multipar, ypart _sa_)
+ fi
+enddef ;
+
+vardef _pmp_x_left_bottom_hang_ (expr i, t) =
+ pair _ll_, _sa_, _pa_ ;
+ _sa_ := if t : llxy[tpos] else : llcorner multipar fi ;
+ if (par_hang_indent>0) and (ra>0) :
+ par_hang_after := max(0,ra - _pmp_estimated_multi_par_height_(i,t)) ;
+ _ll_ := ulcorner multipar ;
+ _pa_ := _ll_ shifted (0,-par_hang_after*par_line_height) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart llcorner multipar)) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart _sa_)) ;
+ % we need to compensate for topskip enlarged areas
+ if abs(ypart _pa_ - ypart _sa_) > par_line_height :
(xpart _pa_ + par_hang_indent,ypart _sa_) --
(xpart _pa_ + par_hang_indent,ypart _pa_) --
- _pa_
- else :
- (xpart lrcorner multipar, ypart _sa_)
fi
- enddef ;
-
- vardef x_left_bottom_hang (expr i, t) =
- pair _ll_, _sa_, _pa_ ;
- _sa_ := if t : llxy[tpos] else : llcorner multipar fi ;
- if (par_hang_indent>0) and (ra>0) :
- par_hang_after := max(0,ra - estimated_multi_par_height(i,t)) ;
- _ll_ := ulcorner multipar ;
- _pa_ := _ll_ shifted (0,-par_hang_after*par_line_height) ;
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart llcorner multipar)) ;
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart _sa_)) ;
- % we need to compensate for topskip enlarged areas
- if abs(ypart _pa_ - ypart _sa_) > par_line_height :
- (xpart _pa_ + par_hang_indent,ypart _sa_) --
- (xpart _pa_ + par_hang_indent,ypart _pa_) --
- fi
- _pa_
- else :
- (xpart llcorner multipar, ypart _sa_)
- fi
- enddef ;
-
- vardef x_right_bottom_hang (expr i, t) =
- pair _lr_, _sa_, _pa_ ;
- _sa_ := if t : snapped_multi_pos(ulxy[tpos]) else : llcorner multipar fi ;
- if (par_hang_indent<0) and (ra>0) :
- par_hang_after := max(0,ra - estimated_multi_par_height(i, t)) ;
- _lr_ := urcorner multipar ;
- _pa_ := _lr_ shifted (0,-par_hang_after*par_line_height) ;
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart lrcorner multipar)) ;
- _pa_ := (xpart _pa_,max(ypart _pa_,ypart _sa_)) ;
- % we need to compensate for topskip enlarged areas
- _pa_
- if abs(ypart _pa_ - ypart _sa_) > par_line_height :
- -- (xpart _pa_ + par_hang_indent,ypart _pa_)
- -- (xpart _pa_ + par_hang_indent,ypart _sa_)
- fi
- else :
- (xpart lrcorner multipar, ypart _sa_)
+ _pa_
+ else :
+ (xpart llcorner multipar, ypart _sa_)
+ fi
+enddef ;
+
+vardef _pmp_x_right_bottom_hang_ (expr i, t) =
+ pair _lr_, _sa_, _pa_ ;
+ _sa_ := if t : _pmp_snapped_multi_pos_(ulxy[tpos]) else : llcorner multipar fi ;
+ if (par_hang_indent<0) and (ra>0) :
+ par_hang_after := max(0,ra - _pmp_estimated_multi_par_height_(i, t)) ;
+ _lr_ := urcorner multipar ;
+ _pa_ := _lr_ shifted (0,-par_hang_after*par_line_height) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart lrcorner multipar)) ;
+ _pa_ := (xpart _pa_,max(ypart _pa_,ypart _sa_)) ;
+ % we need to compensate for topskip enlarged areas
+ _pa_
+ if abs(ypart _pa_ - ypart _sa_) > par_line_height :
+ -- (xpart _pa_ + par_hang_indent,ypart _pa_)
+ -- (xpart _pa_ + par_hang_indent,ypart _sa_)
fi
- enddef ;
+ else :
+ (xpart lrcorner multipar, ypart _sa_)
+ fi
+enddef ;
- def test_multipar =
- multipar := boundingbox multipar ;
- enddef ;
+% def _pmp_test_multipar_ =
+% multipar := boundingbox multipar ;
+% enddef ;
% first loop
@@ -713,7 +714,7 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
TopSkipCorrection := 0 ;
- multipar := set_multipar(i) ;
+ multipar := _pmp_set_multipar_(i) ;
% watch how we compensate for negative indentation
@@ -723,7 +724,8 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
ii := i ;
- if (nxy[tpos]=RealPageNumber) and (InsideTextArea(i,llxy[tpos])) :
+% if (nxy[tpos]=RealPageNumber) and (InsideTextArea(i,llxy[tpos])) :
+ if (nxy[tpos]=RealPageNumber) and (InsideTextArea(i,par_stop_pos)) :
% in same area
@@ -749,9 +751,9 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
llxy[fpos] --
lrxy[tpos] --
%urxy[tpos] --
- snapped_multi_pos(urxy[tpos]) --
+ _pmp_snapped_multi_pos_(urxy[tpos]) --
%ulxy[fpos] --
- snapped_multi_pos(ulxy[fpos]) --
+ _pmp_snapped_multi_pos_(ulxy[fpos]) --
cycle ;
save_multipar (i,1,multipar) ;
@@ -763,9 +765,9 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
multipar := if obey_multi_par_hang :
- right_bottom_hang(true) --
- right_top_hang(true) --
- snapped_multi_pos(urxy[fpos]) --
+ _pmp_right_bottom_hang_(true) --
+ _pmp_right_top_hang_(true) --
+ _pmp_snapped_multi_pos_(urxy[fpos]) --
lrxy[fpos] --
else :
@@ -773,26 +775,26 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
llxy[fpos] --
(xpart urcorner multipar, ypart llxy[fpos]) --
(xpart urcorner multipar, ypart ulxy[fpos]) --
- snapped_multi_pos(ulxy[fpos]) --
+ _pmp_snapped_multi_pos_(ulxy[fpos]) --
fi cycle ;
save_multipar (i,1,multipar) ;
- multipar := set_multipar(i) ;
+ multipar := _pmp_set_multipar_(i) ;
multipar := if obey_multi_par_hang :
- left_bottom_hang(true) --
+ _pmp_left_bottom_hang_(true) --
llxy[tpos] --
- snapped_multi_pos(ulxy[tpos]) --
- left_top_hang(true) --
+ _pmp_snapped_multi_pos_(ulxy[tpos]) --
+ _pmp_left_top_hang_(true) --
else :
(xpart llcorner multipar, ypart llxy[tpos]) --
llxy[tpos] --
- snapped_multi_pos(ulxy[tpos]) --
+ _pmp_snapped_multi_pos_(ulxy[tpos]) --
(xpart llcorner multipar, ypart ulxy[tpos]) --
fi cycle ;
@@ -803,27 +805,27 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
multipar := if obey_multi_par_hang :
- left_bottom_hang(true) --
+ _pmp_left_bottom_hang_(true) --
llxy[tpos] --
%ulxy[tpos] --
- snapped_multi_pos(ulxy[tpos]) --
- right_bottom_hang(true) --
- right_top_hang(true) --
+ _pmp_snapped_multi_pos_(ulxy[tpos]) --
+ _pmp_right_bottom_hang_(true) --
+ _pmp_right_top_hang_(true) --
%urxy[fpos] --
- snapped_multi_pos(urxy[fpos]) --
+ _pmp_snapped_multi_pos_(urxy[fpos]) --
lrxy[fpos] --
- left_top_hang(true) --
+ _pmp_left_top_hang_(true) --
else :
(xpart llcorner multipar, ypart llxy[tpos]) --
llxy[tpos] --
%ulxy[tpos] --
- snapped_multi_pos(ulxy[tpos]) --
+ _pmp_snapped_multi_pos_(ulxy[tpos]) --
(xpart lrcorner multipar, ypart ulxy[tpos]) --
(xpart urcorner multipar, ypart urxy[fpos]) --
%urxy[fpos] --
- snapped_multi_pos(urxy[fpos]) --
+ _pmp_snapped_multi_pos_(urxy[fpos]) --
lrxy[fpos] --
(xpart ulcorner multipar, ypart lrxy[fpos]) --
@@ -837,13 +839,13 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
multipar := if obey_multi_par_hang :
- left_bottom_hang(false) --
- right_bottom_hang(false) --
- right_top_hang(false) --
+ _pmp_left_bottom_hang_(false) --
+ _pmp_right_bottom_hang_(false) --
+ _pmp_right_top_hang_(false) --
%urxy[fpos] --
- snapped_multi_pos(urxy[fpos]) --
+ _pmp_snapped_multi_pos_(urxy[fpos]) --
lrxy[fpos] --
- left_top_hang(false) --
+ _pmp_left_top_hang_(false) --
else :
@@ -851,7 +853,7 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
lrcorner multipar --
(xpart urcorner multipar, ypart urxy[fpos]) --
%urxy[fpos] --
- snapped_multi_pos(urxy[fpos]) --
+ _pmp_snapped_multi_pos_(urxy[fpos]) --
lrxy[fpos] --
(xpart ulcorner multipar, ypart lrxy[fpos]) --
@@ -861,7 +863,8 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
fi ;
- elseif (nxy[tpos]=RealPageNumber) and (InsideTextArea(i,llxy[tpos])) :
+% elseif (nxy[tpos]=RealPageNumber) and (InsideTextArea(i,llxy[tpos])) :
+ elseif (nxy[tpos]=RealPageNumber) and (InsideTextArea(i,par_stop_pos)) :
% last one in chain
@@ -870,12 +873,12 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
if obey_multi_par_hang and obey_multi_par_more :
multipar :=
- x_left_top_hang(i,true) --
- x_right_top_hang(i,true) --
- x_right_bottom_hang(i,true) --
- snapped_multi_pos(ulxy[tpos]) --
+ _pmp_x_left_top_hang_(i,true) --
+ _pmp_x_right_top_hang_(i,true) --
+ _pmp_x_right_bottom_hang_(i,true) --
+ _pmp_snapped_multi_pos_(ulxy[tpos]) --
llxy[tpos] --
- x_left_bottom_hang(i,true) --
+ _pmp_x_left_bottom_hang_(i,true) --
cycle ;
else :
@@ -884,7 +887,7 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
ulcorner multipar --
urcorner multipar --
(xpart lrcorner multipar, ypart urxy[tpos]) --
- snapped_multi_pos(ulxy[tpos]) --
+ _pmp_snapped_multi_pos_(ulxy[tpos]) --
llxy[tpos] --
(xpart llcorner multipar, ypart llxy[tpos]) --
cycle ;
@@ -917,15 +920,15 @@ def prepare_multi_pars (expr fn,fx,fy,fw,fh,fd,
((nxy[fpos]<RealPageNumber) and (nxy[tpos]>RealPageNumber))
:
- multipar := set_multipar(i) ;
+ multipar := _pmp_set_multipar_(i) ;
if obey_multi_par_hang and obey_multi_par_more :
multipar :=
- x_left_top_hang(i,false) --
- x_right_top_hang(i,false) --
- x_right_bottom_hang(i,false) --
- x_left_bottom_hang(i,false) --
+ _pmp_x_left_top_hang_(i,false) --
+ _pmp_x_right_top_hang_(i,false) --
+ _pmp_x_right_bottom_hang_(i,false) --
+ _pmp_x_left_bottom_hang_(i,false) --
cycle ;
fi ;
diff --git a/Master/texmf-dist/metapost/context/base/mp-form.mp b/Master/texmf-dist/metapost/context/base/mp-form.mp
index a65ab6d7374..60ea4cac214 100644
--- a/Master/texmf-dist/metapost/context/base/mp-form.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-form.mp
@@ -15,6 +15,11 @@
boolean mant_font ; mant_font := true ; % signals graph not to load form
+if known mplib :
+ boolean fmt_loaded ; fmt_loaded := true ;
+ expandafter endinput
+fi ;
+
if known fmt_loaded : expandafter endinput fi ;
boolean fmt_loaded ; fmt_loaded := true ;
@@ -78,8 +83,8 @@ begingroup interim warningcheck := 0 ;
%%% Load auxiliary macros.
-input string
-input marith
+input string ;
+input marith ;
%%% Choosing the Layout %%%
@@ -318,7 +323,7 @@ enddef ;
% round and typeset a quantity z in exponent form.
%
% e scientific, p significant figures
-% p decimal, p digits right of the point
+% f decimal, p digits right of the point
% g decimal or scientific, p sig. figs.
% G decimal or scientific, p digits
diff --git a/Master/texmf-dist/metapost/context/base/mp-grid.mp b/Master/texmf-dist/metapost/context/base/mp-grid.mp
index f6e84348915..c87df821cfa 100644
--- a/Master/texmf-dist/metapost/context/base/mp-grid.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-grid.mp
@@ -107,7 +107,12 @@ def do_initialize_numbers =
textext.raw("${\times}10$") ,
textext.raw("${}^-$") ,
textext.raw("${}^2$") ) ;
- numbers_initialized := true ;
+ if unknown _trial_run_ :
+ numbers_initialized := true ;
+ else :
+ % no reset, otherwise textexts get out of sync
+ % slows down graphics a bit but not much
+ fi ;
fi ;
enddef ;
diff --git a/Master/texmf-dist/metapost/context/base/mp-grph.mp b/Master/texmf-dist/metapost/context/base/mp-grph.mp
index 243b45318b0..3cd9f2cfbda 100644
--- a/Master/texmf-dist/metapost/context/base/mp-grph.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-grph.mp
@@ -59,21 +59,25 @@ string graphictextfile ; graphictextfile := "dummy.mpo" ;
def data_mpo_file = job_name & "-mpgraph.mpo" enddef ;
def data_mpy_file = job_name & "-mpgraph.mpy" enddef ;
-def savegraphictext (expr str) =
- if (graphictextstring<>"") :
- write graphictextstring to data_mpo_file ;
- graphictextstring := "" ;
- fi ;
- write str to data_mpo_file ;
- let erasegraphictextfile = relax ;
-enddef ;
+if unknown mplib :
-def erasegraphictextfile =
- write EOF to data_mpo_file ;
- let erasegraphictextfile = relax ;
-enddef ;
+ def savegraphictext (expr str) =
+ if (graphictextstring<>"") :
+ write graphictextstring to data_mpo_file ;
+ graphictextstring := "" ;
+ fi ;
+ write str to data_mpo_file ;
+ let erasegraphictextfile = relax ;
+ enddef ;
-extra_beginfig := extra_beginfig & " erasegraphictextfile ;" ;
+ def erasegraphictextfile =
+ write EOF to data_mpo_file ;
+ let erasegraphictextfile = relax ;
+ enddef ;
+
+ extra_beginfig := extra_beginfig & " erasegraphictextfile ;" ;
+
+fi ;
def begingraphictextfig (expr n) =
foundpicture := n ; scratchpicture := nullpicture ;
@@ -138,7 +142,9 @@ def dographictext (expr t) =
graphictextformat := "" ;
fi ;
currentgraphictext := currentgraphictext + 1 ;
- savegraphictext ("\startTEXpage[scale=10000]" & t & "\stopTEXpage") ;
+ if unknown mplib :
+ savegraphictext ("\startTEXpage[scale=10000]" & t & "\stopTEXpage") ;
+ fi ;
dofinishgraphictext
enddef ;
diff --git a/Master/texmf-dist/metapost/context/base/mp-mlib.mp b/Master/texmf-dist/metapost/context/base/mp-mlib.mp
index bf2372ca390..6c7115cb7d4 100644
--- a/Master/texmf-dist/metapost/context/base/mp-mlib.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-mlib.mp
@@ -2,7 +2,7 @@
%D [ file=mp-mlib.mp,
%D version=2008.03.21,
%D title=\CONTEXT\ \METAPOST\ graphics,
-%D subtitle=specials,
+%D subtitle=plugins,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -16,6 +16,66 @@ if known context_mlib : endinput ; fi ;
boolean context_mlib ; context_mlib := true ;
+%D Color and transparency
+
+newinternal normaltransparent ; normaltransparent := 1 ;
+newinternal multiplytransparent ; multiplytransparent := 2 ;
+newinternal screentransparent ; screentransparent := 3 ;
+newinternal overlaytransparent ; overlaytransparent := 4 ;
+newinternal softlighttransparent ; softlighttransparent := 5 ;
+newinternal hardlighttransparent ; hardlighttransparent := 6 ;
+newinternal colordodgetransparent ; colordodgetransparent := 7 ;
+newinternal colorburntransparent ; colorburntransparent := 8 ;
+newinternal darkentransparent ; darkentransparent := 9 ;
+newinternal lightentransparent ; lightentransparent := 10 ;
+newinternal differencetransparent ; differencetransparent := 11 ;
+newinternal exclusiontransparent ; exclusiontransparent := 12 ;
+
+vardef transparency_alternative_to_number(expr name) =
+ if string name :
+ if expandafter known scantokens(name & "transparent") :
+ scantokens(name & "transparent")
+ else :
+ 0
+ fi
+ elseif name < 13 :
+ name
+ else :
+ 0
+ fi
+enddef ;
+
+def spotcolor(expr n, v) =
+ 1
+ withprescript "sp_name=" & n
+ withprescript "sp_value=" & v
+enddef ;
+
+def multitonecolor(expr name, fractions, components, value) =
+ 1
+ withprescript "sp_name=" & name
+ withprescript "sp_fractions=" & decimal fractions
+ withprescript "sp_components=" & components
+ withprescript "sp_value=" & value
+enddef ;
+
+def transparent(expr alternative, transparency)(text c) =
+ c
+ withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative)
+ withprescript "tr_transparency=" & decimal transparency
+enddef ;
+
+def withtransparency(expr alternative, transparency) =
+ withprescript "tr_alternative=" & decimal transparency_alternative_to_number(alternative)
+ withprescript "tr_transparency=" & decimal transparency
+enddef ;
+
+def cmyk(expr c, m, y, k) =
+ (c,m,y,k)
+enddef ;
+
+% Texts
+
numeric _tt_w_[], _tt_h_[], _tt_d_[] ;
numeric _tt_n_ ; _tt_n_ := 0 ;
picture _tt_p_ ; _tt_p_ := nullpicture ;
@@ -26,34 +86,53 @@ def resettextexts =
_tt_p_ := nullpicture ;
enddef ;
-extra_endfig := ";addto currentpicture also _tt_p_; " & extra_endfig; % was draw _tt_p_
+def flushtextexts =
+ addto currentpicture also _tt_p_
+enddef ;
+
+extra_endfig := "flushtextexts;" & extra_endfig;
extra_beginfig := extra_beginfig & "resettextexts;";
+% We collect and flush them all, as we can also have temporary textexts
+% that gets never really flushed but are used for calculations. So, we
+% flush twice: once in location in order to pick up e.g. color properties,
+% and once at the end because we need to flush missing ones.
+
vardef rawtextext(expr str) =
if str = "" :
nullpicture
elseif _trial_run_ :
+ _tt_n_ := _tt_n_ + 1 ;
+ addto _tt_p_ doublepath unitsquare
+ withprescript "tx_number=" & decimal _tt_n_
+ withprescript "tx_stage=extra"
+ withpostscript str ;
image (
- _tt_n_ := _tt_n_ + 1 ;
- _tt_p_ := image (
- addto currentpicture also _tt_p_ ;
- addto currentpicture doublepath unitsquare withprescript "tf" withpostscript decimal _tt_n_ & ":" & str ;
- ) ;
- addto currentpicture doublepath unitsquare withpen pencircle scaled 0 ;
+ addto currentpicture doublepath unitsquare
+ withprescript "tx_number=" & decimal _tt_n_
+ withprescript "tx_stage=trial"
+ withpostscript str
)
else :
- image (
- _tt_n_ := _tt_n_ + 1 ;
- addto currentpicture doublepath unitsquare
- xscaled _tt_w_[_tt_n_]
- yscaled (_tt_h_[_tt_n_] + _tt_d_[_tt_n_])
- withprescript "ts"
- withpostscript decimal _tt_n_ & ":" & str ;
- ) shifted (0,-_tt_d_[_tt_n_])
+ _tt_n_ := _tt_n_ + 1 ;
+ if known _tt_d_[_tt_n_] :
+ image (
+ addto currentpicture doublepath unitsquare
+ xscaled _tt_w_[_tt_n_]
+ yscaled (_tt_h_[_tt_n_] + _tt_d_[_tt_n_])
+ withprescript "tx_number=" & decimal _tt_n_
+ withprescript "tx_stage=final"
+ ; % withpostscript str ;
+ ) shifted (0,-_tt_d_[_tt_n_])
+ else :
+ image (
+ addto currentpicture doublepath unitsquare ;
+ )
+ fi
fi
enddef ;
-% not ok yet
+% More text
pair laboff.d, laboff.dlft, laboff.drt ; % new positional suffixes
pair laboff.origin, laboff.raw ; % graph mess
@@ -89,44 +168,44 @@ pair laboff.t_r ; laboff.t_r = laboff.urt ;
pair laboff.b_l ; laboff.b_l = laboff.llft ;
pair laboff.b_r ; laboff.b_r = laboff.lrt ;
-labxf.l ; labxf.l = labxf.lft ;
-labxf.r ; labxf.r = labxf.rt ;
-labxf.b ; labxf.b = labxf.bot ;
-labxf.t ; labxf.t = labxf.top ;
-labxf.l_t ; labxf.l_t = labxf.ulft ;
-labxf.r_t ; labxf.r_t = labxf.urt ;
-labxf.l_b ; labxf.l_b = labxf.llft ;
-labxf.r_b ; labxf.r_b = labxf.lrt ;
-labxf.t_l ; labxf.t_l = labxf.ulft ;
-labxf.t_r ; labxf.t_r = labxf.urt ;
-labxf.b_l ; labxf.b_l = labxf.llft ;
-labxf.b_r ; labxf.b_r = labxf.lrt ;
-
-labyf.l ; labyf.l = labyf.lft ;
-labyf.r ; labyf.r = labyf.rt ;
-labyf.b ; labyf.b = labyf.bot ;
-labyf.t ; labyf.t = labyf.top ;
-labyf.l_t ; labyf.l_t = labyf.ulft ;
-labyf.r_t ; labyf.r_t = labyf.urt ;
-labyf.l_b ; labyf.l_b = labyf.llft ;
-labyf.r_b ; labyf.r_b = labyf.lrt ;
-labyf.t_l ; labyf.t_l = labyf.ulft ;
-labyf.t_r ; labyf.t_r = labyf.urt ;
-labyf.b_l ; labyf.b_l = labyf.llft ;
-labyf.b_r ; labyf.b_r = labyf.lrt ;
-
-labtype.l ; labtype.l = labtype.lft ;
-labtype.r ; labtype.r = labtype.rt ;
-labtype.b ; labtype.b = labtype.bot ;
-labtype.t ; labtype.t = labtype.top ;
-labtype.l_t ; labtype.l_t = labtype.ulft ;
-labtype.r_t ; labtype.r_t = labtype.urt ;
-labtype.l_b ; labtype.l_b = labtype.llft ;
-labtype.r_b ; labtype.r_b = labtype.lrt ;
-labtype.t_l ; labtype.t_l = labtype.ulft ;
-labtype.t_r ; labtype.t_r = labtype.urt ;
-labtype.b_l ; labtype.b_l = labtype.llft ;
-labtype.b_r ; labtype.b_r = labtype.lrt ;
+numeric labxf.l ; labxf.l = labxf.lft ;
+numeric labxf.r ; labxf.r = labxf.rt ;
+numeric labxf.b ; labxf.b = labxf.bot ;
+numeric labxf.t ; labxf.t = labxf.top ;
+numeric labxf.l_t ; labxf.l_t = labxf.ulft ;
+numeric labxf.r_t ; labxf.r_t = labxf.urt ;
+numeric labxf.l_b ; labxf.l_b = labxf.llft ;
+numeric labxf.r_b ; labxf.r_b = labxf.lrt ;
+numeric labxf.t_l ; labxf.t_l = labxf.ulft ;
+numeric labxf.t_r ; labxf.t_r = labxf.urt ;
+numeric labxf.b_l ; labxf.b_l = labxf.llft ;
+numeric labxf.b_r ; labxf.b_r = labxf.lrt ;
+
+numeric labyf.l ; labyf.l = labyf.lft ;
+numeric labyf.r ; labyf.r = labyf.rt ;
+numeric labyf.b ; labyf.b = labyf.bot ;
+numeric labyf.t ; labyf.t = labyf.top ;
+numeric labyf.l_t ; labyf.l_t = labyf.ulft ;
+numeric labyf.r_t ; labyf.r_t = labyf.urt ;
+numeric labyf.l_b ; labyf.l_b = labyf.llft ;
+numeric labyf.r_b ; labyf.r_b = labyf.lrt ;
+numeric labyf.t_l ; labyf.t_l = labyf.ulft ;
+numeric labyf.t_r ; labyf.t_r = labyf.urt ;
+numeric labyf.b_l ; labyf.b_l = labyf.llft ;
+numeric labyf.b_r ; labyf.b_r = labyf.lrt ;
+
+numeric labtype.l ; labtype.l = labtype.lft ;
+numeric labtype.r ; labtype.r = labtype.rt ;
+numeric labtype.b ; labtype.b = labtype.bot ;
+numeric labtype.t ; labtype.t = labtype.top ;
+numeric labtype.l_t ; labtype.l_t = labtype.ulft ;
+numeric labtype.r_t ; labtype.r_t = labtype.urt ;
+numeric labtype.l_b ; labtype.l_b = labtype.llft ;
+numeric labtype.r_b ; labtype.r_b = labtype.lrt ;
+numeric labtype.t_l ; labtype.t_l = labtype.ulft ;
+numeric labtype.t_r ; labtype.t_r = labtype.urt ;
+numeric labtype.b_l ; labtype.b_l = labtype.llft ;
+numeric labtype.b_r ; labtype.b_r = labtype.lrt ;
vardef thetextext@#(expr p,z) = % adapted copy of thelabel@
if string p :
@@ -175,6 +254,34 @@ primarydef str infont name = % very naughty !
fi
enddef ;
+% Shades
+
+newinternal shadefactor ; shadefactor := 1 ;
+pair shadeoffset ; shadeoffset := origin ;
+boolean trace_shades ; trace_shades := false ;
+
+def set_linear_vector (suffix a,b)(expr p,n) =
+ if (n=1) : a := llcorner p ; b := urcorner p ;
+ elseif (n=2) : a := lrcorner p ; b := ulcorner p ;
+ elseif (n=3) : a := urcorner p ; b := llcorner p ;
+ elseif (n=4) : a := ulcorner p ; b := lrcorner p ;
+ elseif (n=5) : a := .5[ulcorner p,llcorner p] ; b := .5[urcorner p,lrcorner p] ;
+ elseif (n=6) : a := .5[llcorner p,lrcorner p] ; b := .5[ulcorner p,urcorner p] ;
+ elseif (n=7) : a := .5[lrcorner p,urcorner p] ; b := .5[llcorner p,ulcorner p] ;
+ elseif (n=8) : a := .5[urcorner p,ulcorner p] ; b := .5[lrcorner p,llcorner p] ;
+ else : a := .5[ulcorner p,llcorner p] ; b := .5[urcorner p,lrcorner p] ;
+ fi ;
+enddef ;
+
+def set_circular_vector (suffix ab, r)(expr p,n) =
+ if (n=1) : ab := llcorner p ;
+ elseif (n=2) : ab := lrcorner p ;
+ elseif (n=3) : ab := urcorner p ;
+ elseif (n=4) : ab := ulcorner p ;
+ else : ab := center p ; r := .5r ;
+ fi ;
+enddef ;
+
def circular_shade (expr p, n, ca, cb) =
begingroup ;
save ab, r ; pair ab ; numeric r ;
@@ -186,6 +293,7 @@ def circular_shade (expr p, n, ca, cb) =
fi ;
endgroup ;
enddef ;
+
def linear_shade (expr p, n, ca, cb) =
begingroup ;
save a, b, sh ; pair a, b ;
@@ -196,46 +304,128 @@ def linear_shade (expr p, n, ca, cb) =
fi ;
endgroup ;
enddef ;
+
def withcircularshade (expr a, b, ra, rb, ca, cb) =
- withprescript
- "cs"
- withpostscript
- "0 1 " & decimal shadefactor & " " &
- colordecimals ca & " " & ddecimal (a shifted shadeoffset) & " " & decimal ra & " " &
- colordecimals cb & " " & ddecimal (b shifted shadeoffset) & " " & decimal rb
+ withprescript "sh_type=circular"
+ withprescript "sh_domain=0 1"
+ withprescript "sh_factor=" & decimal shadefactor
+ withprescript "sh_color_a=" & colordecimals ca
+ withprescript "sh_color_b=" & colordecimals cb
+ withprescript "sh_center_a=" & ddecimal (a shifted shadeoffset)
+ withprescript "sh_center_b=" & ddecimal (b shifted shadeoffset)
+ withprescript "sh_radius_a=" & decimal ra
+ withprescript "sh_radius_b=" & decimal rb
enddef ;
+
def withlinearshade (expr a, b, ca, cb) =
- withprescript
- "ls"
- withpostscript
- "0 1 " & decimal shadefactor & " " &
- colordecimals ca & " " & ddecimal (a shifted shadeoffset) & " " &
- colordecimals cb & " " & ddecimal (b shifted shadeoffset)
-enddef ;
-string _defined_cs_pre_[], _defined_cs_post_[] ; numeric _defined_cs_ ; _defined_cs_:= 0 ;
+ withprescript "sh_type=linear"
+ withprescript "sh_domain=0 1"
+ withprescript "sh_factor=" & decimal shadefactor
+ withprescript "sh_color_a=" & colordecimals ca
+ withprescript "sh_color_b=" & colordecimals cb
+ withprescript "sh_center_a=" & ddecimal (a shifted shadeoffset)
+ withprescript "sh_center_b=" & ddecimal (b shifted shadeoffset)
+enddef ;
+
+string _defined_cs_pre_[] ; numeric _defined_cs_ ; _defined_cs_:= 0 ;
+string prescript_separator ; prescript_separator := char(13) ;
+
vardef define_circular_shade (expr a, b, ra, rb, ca, cb) =
_defined_cs_ := _defined_cs_ + 1 ;
- _defined_cs_pre_ [_defined_cs_] := "cs" ;
- _defined_cs_post_[_defined_cs_] := "0 1 " & decimal shadefactor & " " &
- colordecimals ca & " " & ddecimal (a shifted shadeoffset) & " " & decimal ra & " " &
- colordecimals cb & " " & ddecimal (b shifted shadeoffset) & " " & decimal rb ;
+ _defined_cs_pre_ [_defined_cs_] := "sh_type=circular"
+ & prescript_separator & "sh_domain=0 1"
+ & prescript_separator & "sh_factor=" & decimal shadefactor
+ & prescript_separator & "sh_color_a=" & colordecimals ca
+ & prescript_separator & "sh_color_b=" & colordecimals cb
+ & prescript_separator & "sh_center_a=" & ddecimal (a shifted shadeoffset)
+ & prescript_separator & "sh_center_b=" & ddecimal (b shifted shadeoffset)
+ & prescript_separator & "sh_radius_a=" & decimal ra
+ & prescript_separator & "sh_radius_b=" & decimal rb
+ ;
_defined_cs_
enddef ;
+
vardef define_linear_shade (expr a, b, ca, cb) =
_defined_cs_ := _defined_cs_ + 1 ;
- _defined_cs_pre_ [_defined_cs_] := "ls" ;
- _defined_cs_post_[_defined_cs_] := "0 1 " & decimal shadefactor & " " &
- colordecimals ca & " " & ddecimal (a shifted shadeoffset) & " " &
- colordecimals cb & " " & ddecimal (b shifted shadeoffset) ;
+ _defined_cs_pre_ [_defined_cs_] := "sh_type=linear"
+ & prescript_separator & "sh_domain=0 1"
+ & prescript_separator & "sh_factor=" & decimal shadefactor
+ & prescript_separator & "sh_color_a=" & colordecimals ca
+ & prescript_separator & "sh_color_b=" & colordecimals cb
+ & prescript_separator & "sh_center_a=" & ddecimal (a shifted shadeoffset)
+ & prescript_separator & "sh_center_b=" & ddecimal (b shifted shadeoffset)
+ ;
_defined_cs_
enddef ;
+
primarydef p withshade sc =
- p withprescript _defined_cs_pre_[sc] withpostscript _defined_cs_post_[sc]
+ p withprescript _defined_cs_pre_[sc]
+enddef ;
+
+% vardef predefined_linear_shade (expr p, n, ca, cb) =
+% save a, b, sh ; pair a, b ;
+% set_linear_vector(a,b)(p,n) ;
+% define_linear_shade (a,b,ca,cb)
+% enddef ;
+%
+% vardef predefined_circular_shade (expr p, n, ca, cb) =
+% save ab, r ; pair ab ; numeric r ;
+% r := (xpart lrcorner p - xpart llcorner p) ++ (ypart urcorner p - ypart lrcorner p) ;
+% set_circular_vector(ab,r)(p,n) ;
+% define_circular_shade(ab,ab,0,r,ca,cb)
+% enddef ;
+
+% NEW EXPERIMENTAL CODE
+
+def withlinearshading (expr a, b) =
+ withprescript "sh_type=linear"
+ withprescript "sh_domain=0 1"
+ withprescript "sh_factor=" & decimal shadefactor
+ withprescript "sh_center_a=" & ddecimal (a shifted shadeoffset)
+ withprescript "sh_center_b=" & ddecimal (b shifted shadeoffset)
+enddef ;
+
+def withcircularshading (expr a, b, ra, rb) =
+ withprescript "sh_type=circular"
+ withprescript "sh_domain=0 1"
+ withprescript "sh_factor=" & decimal shadefactor
+ withprescript "sh_center_a=" & ddecimal (a shifted shadeoffset)
+ withprescript "sh_center_b=" & ddecimal (b shifted shadeoffset)
+ withprescript "sh_radius_a=" & decimal ra
+ withprescript "sh_radius_b=" & decimal rb
+enddef ;
+
+def withfromshadecolor expr t =
+ withprescript "sh_color=into"
+ withprescript "sh_color_a=" & colordecimals t
+enddef ;
+
+def withtoshadecolor expr t =
+ withprescript "sh_color=into"
+ withprescript "sh_color_b=" & colordecimals t
+enddef ;
+
+def withshading (expr how)(text rest) =
+ if how = "linear" :
+ withlinearshading(rest)
+ elseif how = "circular" :
+ withcircularshading(rest)
+ else :
+ % nothing
+ fi
enddef ;
-def shadecolor(expr sc) = % obsolete
- 1 withprescript _defined_cs_pre_[sc] withpostscript _defined_cs_post_[sc]
+
+primarydef a shadedinto b =
+ 1
+ withprescript "sh_color=into"
+ withprescript "sh_color_a=" & colordecimals a
+ withprescript "sh_color_b=" & colordecimals b
enddef ;
+% END OF NEW
+
+% Graphic text (we will move code here)
+
def graphictext primary t =
if _trial_run_ :
let dographictextindeed = nographictext ;
@@ -244,32 +434,80 @@ def graphictext primary t =
fi
dographictextindeed(t)
enddef ;
+
def dographictext (expr t) =
+ % withprescript "gt_stage=final"
begingroup ;
save figurepicture ; picture figurepicture ;
figurepicture := currentpicture ; currentpicture := nullpicture ;
currentgraphictext := currentgraphictext + 1 ;
dofinishgraphictext
enddef ;
+
def nographictext (expr t) text rest =
- draw unitsquare withprescript "gt" withpostscript t ;
+ draw unitsquare withprescript "gt_stage=trial" withpostscript t
enddef ;
-def savegraphictext (expr str) =
+
+% def savegraphictext (expr str) =
+% enddef ;
+
+% def erasegraphictextfile =
+% enddef ;
+
+% Layers
+
+def onlayer primary name =
+ withprescript "la_name=" & name
enddef ;
-def erasegraphictextfile =
+
+
+% Figures
+
+% def externalfigure primary filename =
+% doexternalfigure (filename)
+% enddef ;
+%
+% def doexternalfigure (expr filename) text transformation =
+% if true : % a bit incompatible esp scaled 1cm now scaled the natural size
+% draw rawtextext("\externalfigure[" & filename & "]") transformation ;
+% else :
+% draw unitsquare transformation withprescript "fg_name=" & filename ;
+% fi ;
+% enddef ;
+
+def withmask primary filename =
+ withprescript "fg_mask=" & filename
enddef ;
def externalfigure primary filename =
- doexternalfigure (filename)
+ if false :
+ rawtextext("\externalfigure[" & filename & "]")
+ else :
+ image (
+ addto currentpicture doublepath unitsquare
+ withprescript "fg_name=" & filename ;
+ )
+% unitsquare
+% withpen pencircle scaled 0
+% withprescript "fg_name=" & filename
+ fi
enddef ;
-def doexternalfigure (expr filename) text transformation =
- draw unitsquare transformation withprescript "fg" withpostscript filename ;
+
+def figure primary filename =
+ rawtextext("\externalfigure[" & filename & "]")
enddef ;
+% Positions
+
def register (expr label, width, height, offset) =
- draw unitsquare xscaled width yscaled height shifted offset withprescript "ps" withpostscript label ;
+ image (
+ addto currentpicture doublepath unitsquare xscaled width yscaled height shifted offset
+ withprescript "ps_label=" & label ;
+ ) ; % no transformations
enddef ;
+% Housekeeping
+
extra_beginfig := extra_beginfig & "currentgraphictext := 0 ; " ;
extra_endfig := extra_endfig & "finishsavingdata ; " ;
extra_endfig := extra_endfig & "resettextexts ; " ;
@@ -277,6 +515,19 @@ extra_endfig := extra_endfig & "resettextexts ; " ;
boolean cmykcolors ; cmykcolors := true ;
boolean spotcolors ; spotcolors := true ;
+% Bonus
+
vardef verbatim(expr str) =
ditto & "\detokenize{" & str & "}" & ditto
enddef ;
+
+% New
+
+def bitmapimage(expr xresolution, yresolution, data) =
+ image (
+ addto currentpicture doublepath unitsquare
+ withprescript "bm_xresolution=" & decimal xresolution
+ withprescript "bm_yresolution=" & decimal yresolution
+ withpostscript data ;
+ )
+enddef ;
diff --git a/Master/texmf-dist/metapost/context/base/mp-page.mp b/Master/texmf-dist/metapost/context/base/mp-page.mp
index 60bfb141754..59d8bccbcd7 100644
--- a/Master/texmf-dist/metapost/context/base/mp-page.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-page.mp
@@ -123,7 +123,7 @@ vardef InsideSavedTextArea (expr _i_, _xy_) =
(round(ypart _xy_) <= round(ypart urcorner SavedTextAreas[_i_])) )
enddef ;
-vardef InsideSomeTextArea(expr _xy_) =
+vardef InsideSomeTextArea (expr _xy_) =
save ok ; boolean ok ; ok := false ;
for i := 1 upto NOfTextAreas :
if InsideTextArea(i,_xy_) : ok := true ; fi ;
@@ -132,7 +132,7 @@ vardef InsideSomeTextArea(expr _xy_) =
ok
enddef ;
-vardef InsideSomeSavedTextArea(expr _xy_) =
+vardef InsideSomeSavedTextArea (expr _xy_) =
save ok ; boolean ok ; ok := false ;
for i := 1 upto NOfSavedTextAreas :
if InsideSavedTextArea(i,_xy_) : ok := true ; fi ;
@@ -211,6 +211,10 @@ vardef TextAreaWH (expr x, y) =
_TextAreaWH_
enddef ;
+string CurrentLayout ;
+
+CurrentLayout := "default" ;
+
PageNumber := 0 ;
PaperHeight := 845.04684pt ;
PaperWidth := 597.50787pt ;
diff --git a/Master/texmf-dist/metapost/context/base/mp-spec.mp b/Master/texmf-dist/metapost/context/base/mp-spec.mp
index 9125b4b8bc2..123e75faaae 100644
--- a/Master/texmf-dist/metapost/context/base/mp-spec.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-spec.mp
@@ -47,6 +47,7 @@
%D for instance shading. More information can be found in
%D type {supp-mpe.tex}.
+if known mplib : endinput ; fi ;
if unknown context_tool : input mp-tool ; fi ;
if known context_spec : endinput ; fi ;
@@ -366,18 +367,16 @@ def circular_shade (expr p, n, ca, cb) =
enddef ;
vardef predefined_linear_shade (expr p, n, ca, cb) =
- save a, b, sh ; pair a, b ;
- set_linear_vector(a,b)(p,n) ;
- set_shade_vector(a,b)(p,n) ;
- define_linear_shade (a,b,ca,cb)
+ save a, b, sh ; pair a, b ;
+ set_linear_vector(a,b)(p,n) ;
+ define_linear_shade (a,b,ca,cb)
enddef ;
vardef predefined_circular_shade (expr p, n, ca, cb) =
- save ab, r ; pair ab ; numeric r ;
- r := (xpart lrcorner p - xpart llcorner p) ++
- (ypart urcorner p - ypart lrcorner p) ;
- set_circular_vector(ab,r)(p,n) ;
- define_circular_shade(ab,ab,0,r,ca,cb)
+ save ab, r ; pair ab ; numeric r ;
+ r := (xpart lrcorner p - xpart llcorner p) ++ (ypart urcorner p - ypart lrcorner p) ;
+ set_circular_vector(ab,r)(p,n) ;
+ define_circular_shade(ab,ab,0,r,ca,cb)
enddef ;
%D Since a \type {fill p withshade s} syntax looks better
@@ -638,8 +637,7 @@ vardef transparent(expr n, t, c) =
flush_special(3, 7, s) ;
fi ;
scantokens(ss) := _special_counter_ ;
- _local_specials_ := _local_specials_ &
- "scantokens(" & ditto & ss & ditto & ") := -1 ;" ;
+ _local_specials_ := _local_specials_ & "scantokens(" & ditto & ss & ditto & ") := -1 ;" ;
fi ;
% go ahead
if is_spot :
@@ -661,6 +659,18 @@ vardef is_transparent(text t) =
endgroup
enddef ;
+% boolean _b_ ; better namespacing
+% color _c_ ;
+% vardef _transparent_(expr nn, tt, cc) = _b_ := true ; cc enddef ;
+% vardef is_transparent(text t) =
+% begingroup ;
+% save transparent ;
+% transparent := _transparent_ ;
+% _b_ := false ;
+% _c_ := t ; _b_
+% endgroup
+% enddef ;
+
%D This function returns the not transparent color.
vardef not_transparent(text t) =
diff --git a/Master/texmf-dist/metapost/context/base/mp-tool.mp b/Master/texmf-dist/metapost/context/base/mp-tool.mp
index 1a748baf9ea..7f047fefcce 100644
--- a/Master/texmf-dist/metapost/context/base/mp-tool.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-tool.mp
@@ -251,6 +251,7 @@ def newtransform text v = forsuffixes i=v : save i ; transform i ; endfor ; endd
def newpath text v = forsuffixes i=v : save i ; path i ; endfor ; enddef ;
def newpicture text v = forsuffixes i=v : save i ; picture i ; endfor ; enddef ;
def newstring text v = forsuffixes i=v : save i ; string i ; endfor ; enddef ;
+def newpair text v = forsuffixes i=v : save i ; pair i ; endfor ; enddef ;
%D Sometimes we don't want parts of the graphics add to the
%D bounding box. One way of doing this is to save the bounding
diff --git a/Master/texmf-dist/metapost/context/font/punkfont-bold.mp b/Master/texmf-dist/metapost/context/font/punkfont-bold.mp
new file mode 100644
index 00000000000..1c62963f9aa
--- /dev/null
+++ b/Master/texmf-dist/metapost/context/font/punkfont-bold.mp
@@ -0,0 +1,4 @@
+boolean bold_punk ; bold_punk := true ;
+
+input "punkfont-definitions.mp" ;
+input "punkfont-characters.mp" ;
diff --git a/Master/texmf-dist/metapost/context/font/punkfont-boldslanted.mp b/Master/texmf-dist/metapost/context/font/punkfont-boldslanted.mp
new file mode 100644
index 00000000000..3e5fa1561df
--- /dev/null
+++ b/Master/texmf-dist/metapost/context/font/punkfont-boldslanted.mp
@@ -0,0 +1,5 @@
+boolean bold_punk ; bold_punk := true ;
+boolean slanted_punk ; slanted_punk := true ;
+
+input "punkfont-definitions.mp" ;
+input "punkfont-characters.mp" ;
diff --git a/Master/texmf-dist/metapost/context/font/punkfont-characters.mp b/Master/texmf-dist/metapost/context/font/punkfont-characters.mp
new file mode 100644
index 00000000000..da0015b02b4
--- /dev/null
+++ b/Master/texmf-dist/metapost/context/font/punkfont-characters.mp
@@ -0,0 +1,726 @@
+initialize_punk_upper ;
+
+beginpunkchar("A",13,1,2);
+z1=pp(1.5u,0); z2=(.5w,1.1h); z3=pp(w-1.5u,0);
+pd z1; pd z3; draw z1--z2--z3; % left and right diagonals
+z4=pp .3[z1,z2]; z5=pp .3[z3,z2]; pd z4; pd z5; draw z4--z5; % crossbar
+endchar;
+
+beginpunkchar("B",12,1,1);
+z1=pp(2u,0); z2=pp(2u,.6h); z3=pp(2u,h); pd z1; pd z3; draw z1--z3; % stem
+z1.5=pp(w-u,.5y2); z2.5=pp(w-u,.5[y2,y3]); draw z2--z2.5--z3; % upper lobe
+draw flex(z2,z1.5,z1); % lower lobe
+endchar;
+
+beginpunkchar("C",13,1,2);
+z1=pp(w-2u,.8h); z2=pp(.6w,h); z3=pp(u,.5h); z4=(.6w,0); z5=(w-2u,.2h);
+pd z1; pd z5; draw z1..z2..z3..z4..z5; % arc
+endchar;
+
+beginpunkchar("D",14,1,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-u,.6h);
+pd z1; pd z2; draw flex(z1,z3,z2); % lobe
+draw z1--z2; % stem
+endchar;
+
+beginpunkchar("E",12,.5,1);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2.5u,h); z4=pp(w-2u,0);
+pd z3; pd z4; draw z4--z1--z2--z3; % stem and arms
+z5=pp(2u,.6h); z6=pp(w-3u,.6h); pd z5; pd z6; draw z5--z6; % crossbar
+endchar;
+
+beginpunkchar("F",12,.5,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,h);
+pd z1; pd z3; draw z1--z2--z3; % stem and arm
+z5=pp(2u,.6h); z6=pp(w-3u,.6h); z4=pp .5[z5,z6]-(0,.1h);
+pd z5; pd z6; draw flex (z5,z4,z6); % crossbar
+endchar;
+
+beginpunkchar("G",13,.5,.5);
+z1=pp(w-2u,.8h); z2=pp(.6w,h); z3=pp(u,.5h); z4=pp(.6w,0); z5=(w-2u,0);
+pd z1; draw z1..z2..z3..z4---z5; % arc
+z6=pp(.5[u,x5],.4h); pd z6; pd z5; draw z6--(pp(x5,y6))--z5; % spur
+endchar;
+
+beginpunkchar("H",14,1,.5);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,0); z4=pp(w-2u,h);
+z5=pp(2u,.6h); z6=pp(w-2u,.6h);
+pd z1; pd z2; pd z3; pd z4; draw z1--z2; draw flex(z3,z6,z4); % stems
+pd z5; draw z5--z6; % crossbar
+endchar;
+
+beginpunkchar("I",5,1,2);
+z1=pp(.5w,0); z2=(.5w,1/3h); z3=(.5w,2/3h); z4=(.5w,h);
+pd z1; pd z4; draw flex(z1,z2,z3,z4); % stem
+endchar;
+
+beginpunkchar("J",9,1,2);
+z1=pp(w-2u,h); z2=pp(w-2u,-.1h); z3=pp(u,0);
+pd z1; pd z3; draw z1--z2--z3; % arc
+endchar;
+
+beginpunkchar("K",14,1,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(2u,1/3h); z4=pp(w-1.5u,h);
+pd z1; pd z2; draw z1--z2; % stem
+pd z3; pd z4; draw z3--z4; % upper diagonal
+z6=pp(w-u,0); z5=1/3[z3,z4];
+pd z6; draw flex(z5,.8[z1,2/3[z5,z6] ],z6);% lower diagonal
+endchar;
+
+beginpunkchar("L",11,1,2);
+z1=pp(2u,h); z2=pp(2u,0); z3=pp(w-1.5u,0);
+pd z1; pd z3; draw z1--z2--z3; % stem and arm
+endchar;
+
+beginpunkchar("M",17,.5,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(.5w,0); z4=pp(w-2u,h); z5=pp(w-2u,0);
+pd z1; pd z5; draw z1--z2--z3--z4--z5; % stems and diagonals
+endchar;
+
+beginpunkchar("N",13,.75,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,0); z4=pp(w-2u,h);
+pd z1; pd z4; draw z1--z2--z3--z4; % stems and diagonals
+endchar;
+
+beginpunkchar("O",12,.5,2);
+z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
+pd z1; draw z1{left}..z2..z3..z4..z1; % bowl
+endchar;
+
+beginpunkchar("P",13,1,2);
+z1=pp(2u,0); z2=pp(2u,1.1h); z3=pp(2u,.5h); z4=pp(w,.6[y3,y2]);
+pd z1; pd z3; draw z1--z2--z4--z3; % stem and bowl
+endchar;
+
+beginpunkchar("Q",14,.5,2);
+z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
+pd z1; draw z1{curl 2}..z2..z3..z4..z1; % bowl
+z5=pp(.4w,.2h); z6=pp(w-u,-.1h); z7=pp(.5[x5,x6],-.2h);
+pd z5; pd z6; draw z5--z7--z6; % tail
+endchar;
+
+beginpunkchar("R",16,1,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-u,.6[y2,y4]); z4=pp(2u,.5h); z5=pp(w-1.5u,0);
+pd z1; pd z2; pd z5; draw z1--flex(z2,z3,z4)--z5; % stem, bowl, and diagonal
+endchar;
+
+beginpunkchar("S",11,.3,1);
+z1=pp(w-2u,.9h); z2=pp(.5w,h); z3=pp(u,.7h); z4=.6[z6,z2];
+z5=pp(w-u,.35h); z6=pp(.5w,u); z7=pp(u,.2h);
+pd z1; pd z7; draw z1--z2...z3..z4..z5...z6--z7; % stroke
+endchar;
+
+beginpunkchar("T",13,.75,2);
+z1=pp(u,h); z2=pp(w-u,h); z3=pp(.5w,0);
+pd z1; pd z2; pd z3; draw z1--z2; % arms
+draw .5[z1,z2]--z3; % stem
+endchar;
+
+beginpunkchar("U",13,.3,2);
+z1=pp(2u,h); z2=pp(2u,.2h); z3=pp(.5w,0); z4=pp(w-2u,.2h); z5=pp(w-2u,h);
+pd z1; pd z5; draw z1---z2...z3{z4-z2}...z4---z5; % stroke
+endchar;
+
+beginpunkchar("V",13,1,2);
+z1=pp(1.5u,h); z2=pp(.5w,0); z3=pp(w-1.5u,h);
+pd z1; pd z3; draw z1--z2--z3; % diagonals
+endchar;
+
+beginpunkchar("W",18,1,2);
+z1=pp(1.5u,h); z2=pp(.5[x1,x3],0); z3=pp(.5w,.8h); z4=pp(.5[x3,x5],0);
+z5=pp(w-1.5u,h);
+pd z1; pd z5; draw z1--z2--z3--z4--z5; % diagonals
+endchar;
+
+beginpunkchar("X",13,1,1);
+z1=pp(1.5u,h); z2=pp(w-1.5u,0); z3=pp(1.5u,0); z4=pp(w-2.5u,h);
+pd z1; pd z2; draw z1--z2; % main diagonal
+pd z3; pd z4; draw z3--z4; % cross diagonal
+endchar;
+
+beginpunkchar("Y",13,1,2);
+z1=pp(1.5u,h); z2=pp(w-1.5u,h); z3=pp(.5w,.5h); z4=pp(.5w,0);
+pd z1; pd z2; pd z4; draw z1--z3--z4; % stem and left diagonal
+draw z2--z3; % right diagonal
+endchar;
+
+beginpunkchar("Z",11,1,2);
+z1=pp(1.5u,h); z2=pp(w-2.5u,h); z3=pp(1.5u,0); z4=pp(w-1.5u,0);
+pd z1; pd z4; draw z1--z2--z3--z4; % diagonals
+endchar;
+
+beginpunkchar(198,16,1,2); % \AE
+z1=pp(1.5u,0); z2=pp(.6w,h); z3=pp(w-1.5u,h);
+pd z1; pd z3; draw z1--z2--z3; % left diagonal and upper arm
+z4=pp .3[z1,z2]; z5=pp(.6w,0); z6=pp(w-2u,.3h);
+pd z4; pd z6; draw z4--z6; % crossbar
+z7=pp(w-u,0); pd z2; pd z7; draw z2--z5--z7; % stem and lower arm
+endchar;
+
+beginpunkchar(338,18,1,2); % \OE
+z1=pp(.5w,h); z2=pp(u,.4h); z3=pp(.5w,0);
+pd z1; draw z1..z2..{right}z3; % bowl
+z4=pp(w-1.5u,h); z5=pp(w-2u,.4h); z6=pp(w-u,0);
+pd z4; pd z6; draw z4--z1--z3--z6; % arms and stem
+pd z5; draw z5--.4[z3,z1]; % crossbar
+endchar;
+
+beginpunkchar(216,14,1,1); % \O
+z1=pp(.5w,h); z2=pp(u,.5h); z3=pp(.5w,0); z4=pp(w-u,.5h);
+z5=pp(w-2u,1.1h); z6=pp(2u,-.1h);
+pd z1; pd z6; draw z1..z2..z3..z4..z5--z6; % bowl and diagonal
+endchar;
+
+beginpunkchar(915,11,1,2); % $\Gamma$
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-1.5u,h);
+pd z1; pd z3; draw z1--z2--z3; % stem and arm
+endchar;
+
+beginpunkchar(916,15,1,2); % $\Delta$
+z1=pp(u,0); z2=pp(.5w,h); z3=pp(w-u,0);
+pd z1; draw z1--z2..tension 5..z3..tension 5..z1; % triangle
+endchar;
+
+beginpunkchar(920,15,.5,2); % $\Theta$
+z1=pp(.5w,h); z2=pp(u,.6h); z3=pp(.5w,0); z4=pp(w-u,.6h);
+pd z1; draw z1..tension.8..z2..z3..z4..tension.8..z1; % bowl
+z5=pp(x2+2u,.4h); z6=pp(x4-2u,.4h); pd z5; pd z6; draw z5--z6; % bar
+endchar;
+
+beginpunkchar(923,12,1,2); % $\Lambda$
+z1=pp(u,0); z2=pp(.5w,h); z3=pp(w-u,0);
+pd z1; pd z3; draw z1--z2--z3; % diagonals
+endchar;
+
+beginpunkchar(926,12,1,1); % $\Xi$
+z1=pp(u,h); z2=pp(w-u,h); pd z1; pd z2; draw z1--z2; % upper arm
+z3=pp(2u,.55h); z4=pp(w-2u,.55h); pd z3; pd z4; draw z3--z4; % bar
+z5=pp(u,0); z6=pp(w-u,0); pd z5; pd z6; draw z5--z6; % lower arm
+endchar;
+
+beginpunkchar(928,13,1,.5); % $\Pi$
+z1=pp(1.5u,0); z2=pp(1.5u,h); z3=pp(w-1.5u,h); z4=pp(w-1.5u,0);
+pd z1; pd z4; draw z1--z2--z3--z4; % stems and bar
+endchar;
+
+beginpunkchar(931,13,1,1); % $\Sigma$
+z1=pp(w-u,h); z2=pp(u,h); z3=pp(.5w-u,.5h); z4=pp(u,0); z5=pp(w-u,0);
+pd z1; pd z5; draw z1--z2{.5[z4,z5]-z2}..z3--z4--z5; % arms and diagonals
+endchar;
+
+beginpunkchar(933,15,1,.5); % $\Upsilon$
+z1=pp(u,.8h); z2=pp(.3w,h); z3=pp(.5w,.5h); z4=pp(.5w,0);
+pd z1; pd z4; draw z1..z2..tension2..z3---z4; % left arc and stem
+z5=pp(w-u,.8h); z6=pp(.7w,h);
+pd z5; draw z5..z6..tension2..{z4-z3}z3; % right arc
+endchar;
+
+beginpunkchar(934,13,1,2); % $\Phi$
+z1=pp(.5w,h); z2=pp(.5w,0); pd z1; pd z2; draw z1--z2; % stem
+z3=pp(.5w,2/3h); z4=pp(u,.5h); z5=pp(.5w,1/4h); z6=pp(w-u,.5h);
+pd z3; draw z3..z4..z5..z6..z3; % bowl
+endchar;
+
+beginpunkchar(936,14,1,1); % $\Psi$
+z1=pp(.5w,h); z2=pp(.5w,0); pd z1; pd z2; draw z1--z2; % stem
+z3=pp(u,.8h); z4=pp(.5w,.2h); z5=pp(w-u,.8h);
+pd z3; pd z5; draw z3{.4[z1,z2]-z3}..z4{right}..{z5-.4[z1,z2]}z5; % stroke
+endchar;
+
+beginpunkchar(937,13,1,2); % $\Omega$
+z1=pp(u,0); z2=pp(1/3w,0); z3=pp(u,2/3h); z4=pp(.5w,h);
+z5=pp(w-u,2/3h); z6=pp(2/3w,0); z7=pp(w-u,0);
+pd z1; pd z7; draw z1--z2{up}..z3..z4..z5..{down}z6--z7; % bowl and arms
+endchar;
+
+beginpunkchar(".",5,1,2);
+pd pp(.5w,0); % dot
+endchar;
+
+beginpunkchar(",",5,.5,.5);
+z1=pp(.5w,0); z2=pp(w-u,-.1h); z3=pp(.5w,-.3h);
+pd z1; pd z3; draw z1--z2--z3; % stroke
+endchar;
+
+beginpunkchar(":",5,1,.5);
+pd pp(.5w,0); pd pp(.5w,.4h); % dots
+endchar;
+
+beginpunkchar(";",5,.5,.5);
+z1=pp(.5w,0); z2=pp(w-u,-.1h); z3=pp(.5w,-.3h);
+pd z1; pd z3; draw z1--z2--z3; % stroke
+pd pp(.5w,.4h); % dot
+endchar;
+
+beginpunkchar("!",5,.5,.5);
+pd pp(.5w,0); % dot
+z1=pp(.5w,1.05h); z2=pp(.5w,.3h); pd z1; pd z2; draw z1--z2; % stem
+endchar;
+
+beginpunkchar(161,5,.5,.5); % spanish inverted !
+pd pp(.5w,.9h); % dot
+z1=pp(.5w,-.1h); z2=pp(.5w,.6h); pd z1; pd z2; draw z1--z2; % stem
+endchar;
+
+beginpunkchar("?",9,1,.5);
+z1=pp(1.5u,.8h); z2=pp(.5w,h); z3=pp(w-u,.8h); z4=pp(.5w,.3h);
+pd z1; pd z4; draw z1..z2..z3..{down}z4; % arc and stem
+pd pp(.5w,0); % dot
+endchar;
+
+beginpunkchar(191,9,1,.5); % spanish inverted ?
+z1=pp(1.5u,.1h); z2=pp(.5w,-.1h); z3=pp(w-u,.1h); z4=pp(.5w,.6h);
+pd z1; pd z4; draw z1..z2..z3..{up}z4; % arc and stem
+pd pp(.5w,.9h); % dot
+endchar;
+
+beginpunkchar("&",14,.5,.5);
+z1=pp(w-2u,h); z2=pp(u,h); z3=pp(3u,0); z5=pp(w-u,.6h); z6=pp(w-2u,0);
+pd z1; pd z5; draw z1--z2--z3--z5; % arms and stem
+draw z1--.5[z2,z3]; pd z6; draw z6--.6[z3,z5]; % diagonals
+endchar;
+
+beginpunkchar("$",12,.5,.5);
+z1=pp(w-1.5u,.7h); z2=pp(.5w,h); z3=pp(u,.7h); z4=.5[z3,z5];
+z5=pp(w-u,.3h); z6=pp(.5w,0); z7=pp(u,.3h);
+pd z1; pd z7; draw z1..z2..z3..z4..z5..z6..z7; % stroke
+z8=z2+(0,.1h); pd z8; draw z8--z6; % stem
+endchar;
+
+beginpunkchar("%",18,.5,.5);
+z1=pp(3.5u,1.1h); z2=pp(u,.8h); z3=pp(3.5u,.5h); z4=pp(6u,.8h);
+z5=pp(w-3.5u,.5h); z6=pp(w-6u,.2h); z7=pp(w-3.5u,-.1h); z8=pp(w-u,.2h);
+pd z1; draw z1..z2..z3..z4..z1; % upper bowl
+pd z5; draw z5..z6..z7..z8..z5; % lower bowl
+z9=pp(w-3u,1.1h); z0=pp(3u,-.1h); pd z0; draw z9--z0; % diagonal
+draw z1{z5-z1}..z9; % link
+endchar;
+
+beginpunkchar("@",18,1,.5);
+z1=pp(2u,0); z2=pp(1/3w,.7h); z3=pp(w-6u,0);
+z4=pp(w,.3h); z5=pp(1/3w,h); z6=pp(u,.5h); z7=.7[z2,z3];
+pd z1; pd z7; draw z1--z2--z3{right}..z4..z5..z6..z7; % diagonals and stroke
+endchar;
+
+beginpunkchar("-",7,.5,.5);
+z1=pp(u,.4h); z2=pp(w-u,.5h); pd z1; pd z2; draw z1--z2; % bar
+endchar;
+
+beginpunkchar(8211,9,.5,.5); % --
+z1=pp(0,.5h); z2=pp(w,.4h); pd z1; pd z2; draw z1--z2; % bar
+endchar;
+
+beginpunkchar(8212,18,.5,.5); % ---
+z1=pp(0,.5h); z2=pp(w,.4h); pd z1; pd z2; draw z1--z2; % bar
+endchar;
+
+beginpunkchar("+",9,.5,1);
+z1=pp(0,.5h); z2=pp(w,.5h); pd z1; pd z2; draw z1--z2; % bar
+z3=pp(.5w,.1h); z4=pp(.5w,.9h); pd z3; pd z4; draw z3--z4; % stem
+endchar;
+
+beginpunkchar("*",13,.5,1);
+z0=pp(.5w,1.1h); z1=pp(u,.9h); z2=pp(2u,.3h); z3=pp(w-u,.3h); z4=pp(w-u,.9h);
+pd z0; draw z0--z2..1/3[.5[z2,z4],z0]..z4--z1--z3--z0; % star
+endchar;
+
+beginpunkchar(39,5,.5,1.5); % ' apostrofe HH/TH (to be checked)
+z1=pp(w/2,h); z2=pp(w/2+u,.85h); z3=pp(w/2,2/3h);
+pd z1; pd z3; draw z1..z2..z3; % stroke
+endchar;
+
+beginpunkchar(34,9,1,1.5); % " HH/TH (to be checked)
+z1=pp(1.5u,h); z2=pp(1.5u,.6h); z3=pp(w-1.5u,h); z4=pp(w-1.5u,.6h);
+pd z1; pd z2; pd z3; pd z4; draw z1--z2; draw z3--z4;
+endchar;
+
+beginpunkchar(8216,5,.3,.5); % `
+z1=pp(w-1.5u,h); z2=pp(u,.85h); z3=pp(w-u,2/3h);
+pd z1; pd z3; draw z1--z2--z3; % stroke
+endchar;
+
+beginpunkchar(8217,5,.3,.5); % '
+z1=pp(1.5u,h); z2=pp(w-u,.85h); z3=pp(u,2/3h);
+pd z1; pd z3; draw z1--z2--z3; % stroke
+endchar;
+
+beginpunkchar(8220,9,.3,.5); % `` quotedblleft
+z1=pp(.5w+.5u,h); z2=pp(w-u,.6h); z3=pp(u,.95h);
+pd z1; pd z3; draw z1--z2--z3; % stroke
+endchar;
+
+beginpunkchar(8221,9,.3,.5); % '' quotedblright
+z1=pp(.5w-.5u,h); z2=pp(u,.6h); z3=pp(w-u,.95h);
+pd z1; pd z3; draw z1--z2--z3; % stroke
+endchar;
+
+beginpunkchar("(",7,.5,.5);
+z1=pp(w-u,h); z2=pp(u,.5h); z3=pp(w-u,0);
+pd z1; pd z3; draw z1..z2..z3; % stroke
+endchar;
+
+beginpunkchar(")",7,.5,.5);
+z1=pp(u,h); z2=pp(w-u,.5h); z3=pp(u,0); pd z1; pd z3; draw z1..z2..z3; % stroke
+endchar;
+
+beginpunkchar("[",8,.5,.5);
+z1=pp(w-u,h); z2=pp(.5w,h); z3=pp(.5w,0); z4=pp(w-u,0);
+pd z1; pd z4; draw z1--z2--z3--z4; % bars and stem
+endchar;
+
+beginpunkchar("]",8,.5,.5);
+z1=pp(u,h); z2=pp(.5w,h); z3=pp(.5w,0); z4=pp(u,0);
+pd z1; pd z4; draw z1--z2--z3--z4; % bars and stem
+endchar;
+
+beginpunkchar("<",9,.5,.5);
+z1=pp(w-u,.9h); z2=pp(u,.5h); z3=pp(w-u,.1h);
+pd z1; pd z3; draw z1--z2--z3; % diagonals
+endchar;
+
+beginpunkchar(">",9,.5,.5);
+z1=pp(u,.9h); z2=pp(w-u,.5h); z3=pp(u,.1h);
+pd z1; pd z3; draw z1--z2--z3; % diagonals
+endchar;
+
+beginpunkchar("{",10,.5,.5); % HH/TH
+z1=pp(w-2u,h); z3=pp(2u,.5h); z5=pp(w-2u,0);
+z2=pp(w-4u,.6h); z4=(w-4u,.4h);
+pd z1; pd z3; pd z5; draw z1{left}..z2--z3 & z3--z4..{right}z5;
+endchar;
+
+beginpunkchar("}",10,.5,.5); % HH/TH
+z1=pp(2u,h); z3=pp(w-2u,.5h); z5=pp(2u,0);
+z2=pp(4u,.6h); z4=(4u,.4h);
+pd z1; pd z3; pd z5; draw z1{right}..z2--z3 & z3--z4..{left}z5;
+endchar;
+
+beginpunkchar("=",9,.5,.5);
+z5=pp(u,2/3h); z6=pp(w-u,2/3h); pd z5; pd z6; draw z5--z6; % upper bar
+z7=pp(u,1/3h); z8=pp(w-u,1/3h); pd z7; pd z8; draw z7--z8; % lower bar
+endchar;
+
+beginpunkchar("#",15,.5,.5);
+z1=pp(.5w,h); z2=pp(3u,0); z3=pp(w-3u,h); z4=pp(.5w,0);
+pd z2; pd z3; draw z3--z1--z2; draw z3--z4--z2; % diagonals (linked)
+z5=pp(u,2/3h); z6=pp(w-u,2/3h); pd z5; pd z6; draw z5--z6; % upper bar
+z7=pp(u,1/3h); z8=pp(w-u,1/3h); pd z7; pd z8; draw z7--z8; % lower bar
+endchar;
+
+beginpunkchar("/",9,1,1);
+z1=pp(1.5u,-.05h); z2=pp(w-1.5u,1.05h); pd z1; pd z2; draw z1--z2; % diagonal
+endchar;
+
+beginpunkchar("\",9,1,1); % HH/TH
+z1=pp(1.5u,1.05h); z2=pp(w-1.5u,-.05h); pd z1; pd z2; draw z1--z2; % reverse diagonal
+endchar;
+
+
+beginpunkchar("0",9,.5,1);
+z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
+pd z1; draw z1{curl 2}..z2..z3..z4..z1; % bowl
+endchar;
+
+beginpunkchar("1",9,.3,1);
+z1=pp(2u,.7h); z2=pp(.6w,h); z3=pp(.6w,0);
+pd z1; pd z3; draw z1--z2--z3; % serif and stem
+endchar;
+
+beginpunkchar("2",9,1,1);
+z1=pp(2u,.7h); z2=pp(.5w,h); z3=pp(w-u,.6h); z4=pp(u,0); z5=pp(w-2u,0);
+pd z1; pd z5; draw z1..z2..z3..z4--z5; % stroke
+endchar;
+
+beginpunkchar("3",9,.5,.5);
+z1=pp(2u,.7h); z2=pp(.5w,h); z3=pp(w-u,.5[y2,y4]);
+z4=pp(.5w-u,.55h); z5=pp(w-u,.5[y4,y6]); z6=pp(.5w,0); z7=pp(1.5u,.2h);
+pd z1; pd z7; draw z1..z2..z3..z4&z4..z5..z6..z7; % arcs
+endchar;
+
+beginpunkchar("4",9,1,1);
+z1=pp(w-u,.3h); z2=pp(u,.3h); z3=pp(2/3w,h); z4=pp(2/3w,0);
+pd z1; pd z4; draw z1--z2--z3--z4; % stem and diagonals
+endchar;
+
+beginpunkchar("5",9,.5,.5);
+z1=pp(w-2u,h); z2=pp(2u,h); z3=pp(u,.7h); z4=pp(w-u,.5[y3,y5]);
+z5=pp(.5w,0); z6=pp(u,.2h);
+pd z1; pd z6; draw z1--z2--z3..z4..z5..z6; % stroke
+endchar;
+
+beginpunkchar("6",9,1,1);
+z1=pp(2/3w,h); z2=pp(u,.3h); z3=pp(.5w,0); z4=pp(w-u,.3h); z5=pp(.6w,.6h);
+z6=pp z2; pd z1; pd z6; draw z1..z2..z3..z4..z5--z6; % stroke
+endchar;
+
+beginpunkchar("7",9,.5,1);
+z1=pp(2u,h); z2=pp(w-.5u,h); z3=pp(.4w,0);
+pd z1; pd z3; draw z1--z2&z2..z3{down}; % stroke
+endchar;
+
+beginpunkchar("8",9,.5,.5);
+z1=pp(.5w,h); z2=pp(u,.5[y1,y3]); z3=pp(.5w,.6h); z4=pp(w-u,.5[y3,y5]);
+z5=pp(.5w,0); z6=pp(u,.5[y5,y3]); z7=pp(w-u,.5[y1,y3]);
+pd z1; draw z1{curl 8}..z2..z3..z4..z5..z6..z3..z7..z1; % stroke
+endchar;
+
+beginpunkchar("9",9,1,1);
+z1=pp(1/3w,0); z2=pp(w-u,.7h); z3=pp(.5w,h); z4=pp(u,.7h); z5=pp(.5w,.4h);
+pd z1; pd z5; draw z1..z2..z3..z4..z5; % stroke
+endchar;
+
+beginpunkchar(96,9,1,1); % \`{} grave
+z1=pp(2.5u,h); z2=pp(.6w,.8h); pd z1; pd z2; draw z1--z2; % diagonal
+endchar;
+
+beginpunkchar(180,9,1,1); % \'{} acute
+z1=pp(w-2.5u,h); z2=pp(.4w,.8h); pd z1; pd z2; draw z1--z2; % diagonal
+endchar;
+
+beginpunkchar(710,13,1,1); % \^{} circumflex
+z1=pp(2.5u,.8h); z2=pp(.5w,h); z3=(w-2.5u,.8h);
+pd z1; pd z3; draw z1--z2--z3; % diagonals
+endchar;
+
+beginpunkchar(711,13,1,1); % \v{} caron
+z1=pp(2.5u,.9h); z2=pp(.5w,.7h); z3=pp(w-2.5u,.9h);
+pd z1; pd z3; draw z1--z2--z3; % diagonals
+endchar;
+
+beginpunkchar(728,11,1,1); % \u{} breve
+z1=pp(2u,h); z2=pp(.5w,.75h); z3=pp(w-2u,h);
+pd z1; pd z3; draw flex(z1,z2,z3); % stroke
+endchar;
+
+beginpunkchar(175,12,1,1); % \={} macron
+z1=pp(u,.8h); z2=pp(w-u,.8h); pd z1; pd z2; draw z1--z2; % bar
+endchar;
+
+beginpunkchar(729,5,1,1); % \.{}
+pd pp(.5w,.9h); % dot
+endchar;
+
+beginpunkchar(168,13,1,1); % \"{} diaeresis
+pd pp(1/5w,.9h); pd pp(4/5w,.9h); % dots
+endchar;
+
+beginpunkchar(732,13,1,1); % \~{} tilde
+z1=pp(u,.75h); z2=pp(w-u,.9h); pd z1; pd z2; draw z1{up}..{up}z2; % stroke
+endchar;
+
+beginpunkchar(733,13,1,1); % \H{} hungarumlaut
+z1=pp(4u,h); z2=pp(2.5u,.7h); z3=pp(w-2u,h); z4=pp(w-3.5u,.7h);
+pd z1; pd z3; draw z1--z2--z4--z3; % diagonals (linked)
+endchar;
+
+beginpunkchar(730,13,0,0); % Scandinavian loop, for \AA\ and \aa (ring)
+z0=(.5w,.66h); % point $z^2$ of lowercase A
+z1=(.5w,.9h); draw z0{z0-(1.5u,0)}..z1..{(w-1.5u,0)-z0}z0; % loop
+endchar;
+
+beginpunkchar(184,13,.5,.5); % Cedilla, for \c c
+z1=(.6w,0); z2=pp(.6w,-.1h); z3=pp(2.5u,-.1h);
+pd z3; draw z1--z2--z3; % stroke
+endchar;
+
+initialize_punk_lower ;
+
+beginpunkchar(305,5,1,2); % dotless I
+z1=pp(.5w,0); z2=(.5w,1/3h); z3=(.5w,2/3h); z4=(.5w,h);
+pd z1; pd z4; draw flex(z1,z2,z3,z4); % stem
+endchar;
+
+beginpunkchar(567,9,1,2); % dotless J
+z1=pp(w-2u,h); z2=pp(w-2u,-.1h); z3=pp(u,0);
+pd z1; pd z3; draw z1--z2--z3; % arc
+endchar;
+
+beginpunkchar(223,18,.3,1); % German SS
+z1=pp(.5w-u,.9h); z2=pp(1/3w,h); z3=pp(u,.7h); z4=.6[z6,z2];
+z5=pp(.5w,.35h); z6=pp(1/3w,u); z7=pp(u,.2h);
+pd z1; pd z7; draw z1--z2...z3..z4..z5...z6--z7; % left stroke
+for i=1 upto 7: z[i+10]=pp(z[i] shifted (.5w-u,0)); endfor
+pd z11; pd z17; draw z11--z12...z13..z14..z15...z16--z17; % right stroke
+endchar;
+
+beginpunkchar("a",13,1,2);
+z1=pp(1.5u,0); z2=(.5w,1.1h); z3=pp(w-1.5u,0);
+pd z1; pd z3; draw z1--z2--z3; % left and right diagonals
+z4=pp .3[z1,z2]; z5=pp .3[z3,z2]; pd z4; pd z5; draw z4--z5; % crossbar
+endchar;
+
+beginpunkchar("b",12,1,1);
+z1=pp(2u,0); z2=pp(2u,.6h); z3=pp(2u,h); pd z1; pd z3; draw z1--z3; % stem
+z1.5=pp(w-u,.5y2); z2.5=pp(w-u,.5[y2,y3]); draw z2--z2.5--z3; % upper lobe
+draw flex(z2,z1.5,z1); % lower lobe
+endchar;
+
+beginpunkchar("c",13,1,2);
+z1=pp(w-2u,.8h); z2=pp(.6w,h); z3=pp(u,.5h); z4=(.6w,0); z5=(w-2u,.2h);
+pd z1; pd z5; draw z1..z2..z3..z4..z5; % arc
+endchar;
+
+beginpunkchar("d",14,1,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-u,.6h);
+pd z1; pd z2; draw flex(z1,z3,z2); % lobe
+draw z1--z2; % stem
+endchar;
+
+beginpunkchar("e",12,.5,1);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2.5u,h); z4=pp(w-2u,0);
+pd z3; pd z4; draw z4--z1--z2--z3; % stem and arms
+z5=pp(2u,.6h); z6=pp(w-3u,.6h); pd z5; pd z6; draw z5--z6; % crossbar
+endchar;
+
+beginpunkchar("f",12,.5,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,h);
+pd z1; pd z3; draw z1--z2--z3; % stem and arm
+z5=pp(2u,.6h); z6=pp(w-3u,.6h); z4=pp .5[z5,z6]-(0,.1h);
+pd z5; pd z6; draw flex (z5,z4,z6); % crossbar
+endchar;
+
+beginpunkchar("g",13,.5,.5);
+z1=pp(w-2u,.8h); z2=pp(.6w,h); z3=pp(u,.5h); z4=pp(.6w,0); z5=(w-2u,0);
+pd z1; draw z1..z2..z3..z4---z5; % arc
+z6=pp(.5[u,x5],.4h); pd z6; pd z5; draw z6--(pp(x5,y6))--z5; % spur
+endchar;
+
+beginpunkchar("h",14,1,.5);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,0); z4=pp(w-2u,h);
+z5=pp(2u,.6h); z6=pp(w-2u,.6h);
+pd z1; pd z2; pd z3; pd z4; draw z1--z2; draw flex(z3,z6,z4); % stems
+pd z5; draw z5--z6; % crossbar
+endchar;
+
+beginpunkchar("i",5,1,2);
+z1=pp(.5w,0); z2=(.5w,1/3h); z3=(.5w,2/3h); z4=(.5w,h);
+pd z1; pd z4; draw flex(z1,z2,z3,z4); % stem
+endchar;
+
+beginpunkchar("j",9,1,2);
+z1=pp(w-2u,h); z2=pp(w-2u,-.1h); z3=pp(u,0);
+pd z1; pd z3; draw z1--z2--z3; % arc
+endchar;
+
+beginpunkchar("k",14,1,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(2u,1/3h); z4=pp(w-1.5u,h);
+pd z1; pd z2; draw z1--z2; % stem
+pd z3; pd z4; draw z3--z4; % upper diagonal
+z6=pp(w-u,0); z5=1/3[z3,z4];
+pd z6; draw flex(z5,.8[z1,2/3[z5,z6] ],z6);% lower diagonal
+endchar;
+
+beginpunkchar("l",11,1,2);
+z1=pp(2u,h); z2=pp(2u,0); z3=pp(w-1.5u,0);
+pd z1; pd z3; draw z1--z2--z3; % stem and arm
+endchar;
+
+beginpunkchar("m",17,.5,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(.5w,0); z4=pp(w-2u,h); z5=pp(w-2u,0);
+pd z1; pd z5; draw z1--z2--z3--z4--z5; % stems and diagonals
+endchar;
+
+beginpunkchar("n",13,.75,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,0); z4=pp(w-2u,h);
+pd z1; pd z4; draw z1--z2--z3--z4; % stems and diagonals
+endchar;
+
+beginpunkchar("o",12,.5,2);
+z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
+pd z1; draw z1{left}..z2..z3..z4..z1; % bowl
+endchar;
+
+beginpunkchar("p",13,1,2);
+z1=pp(2u,0); z2=pp(2u,1.1h); z3=pp(2u,.5h); z4=pp(w,.6[y3,y2]);
+pd z1; pd z3; draw z1--z2--z4--z3; % stem and bowl
+endchar;
+
+beginpunkchar("q",14,.5,2);
+z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
+pd z1; draw z1{curl 2}..z2..z3..z4..z1; % bowl
+z5=pp(.4w,.2h); z6=pp(w-u,-.1h); z7=pp(.5[x5,x6],-.2h);
+pd z5; pd z6; draw z5--z7--z6; % tail
+endchar;
+
+beginpunkchar("r",16,1,2);
+z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-u,.6[y2,y4]); z4=pp(2u,.5h); z5=pp(w-1.5u,0);
+pd z1; pd z2; pd z5; draw z1--flex(z2,z3,z4)--z5; % stem, bowl, and diagonal
+endchar;
+
+beginpunkchar("s",11,.3,1);
+z1=pp(w-2u,.9h); z2=pp(.5w,h); z3=pp(u,.7h); z4=.6[z6,z2];
+z5=pp(w-u,.35h); z6=pp(.5w,u); z7=pp(u,.2h);
+pd z1; pd z7; draw z1--z2...z3..z4..z5...z6--z7; % stroke
+endchar;
+
+beginpunkchar("t",13,.75,2);
+z1=pp(u,h); z2=pp(w-u,h); z3=pp(.5w,0);
+pd z1; pd z2; pd z3; draw z1--z2; % arms
+draw .5[z1,z2]--z3; % stem
+endchar;
+
+beginpunkchar("u",13,.3,2);
+z1=pp(2u,h); z2=pp(2u,.2h); z3=pp(.5w,0); z4=pp(w-2u,.2h); z5=pp(w-2u,h);
+pd z1; pd z5; draw z1---z2...z3{z4-z2}...z4---z5; % stroke
+endchar;
+
+beginpunkchar("v",13,1,2);
+z1=pp(1.5u,h); z2=pp(.5w,0); z3=pp(w-1.5u,h);
+pd z1; pd z3; draw z1--z2--z3; % diagonals
+endchar;
+
+beginpunkchar("w",18,1,2);
+z1=pp(1.5u,h); z2=pp(.5[x1,x3],0); z3=pp(.5w,.8h); z4=pp(.5[x3,x5],0);
+z5=pp(w-1.5u,h);
+pd z1; pd z5; draw z1--z2--z3--z4--z5; % diagonals
+endchar;
+
+beginpunkchar("x",13,1,1);
+z1=pp(1.5u,h); z2=pp(w-1.5u,0); z3=pp(1.5u,0); z4=pp(w-2.5u,h);
+pd z1; pd z2; draw z1--z2; % main diagonal
+pd z3; pd z4; draw z3--z4; % cross diagonal
+endchar;
+
+beginpunkchar("y",13,1,2);
+z1=pp(1.5u,h); z2=pp(w-1.5u,h); z3=pp(.5w,.5h); z4=pp(.5w,0);
+pd z1; pd z2; pd z4; draw z1--z3--z4; % stem and left diagonal
+draw z2--z3; % right diagonal
+endchar;
+
+beginpunkchar("z",11,1,2);
+z1=pp(1.5u,h); z2=pp(w-2.5u,h); z3=pp(1.5u,0); z4=pp(w-1.5u,0);
+pd z1; pd z4; draw z1--z2--z3--z4; % diagonals
+endchar;
+
+beginpunkchar(230,16,1,2); % \ae
+z1=pp(1.5u,0); z2=pp(.6w,h); z3=pp(w-1.5u,h);
+pd z1; pd z3; draw z1--z2--z3; % left diagonal and upper arm
+z4=pp .3[z1,z2]; z5=pp(.6w,0); z6=pp(w-2u,.3h);
+pd z4; pd z6; draw z4--z6; % crossbar
+z7=pp(w-u,0); pd z2; pd z7; draw z2--z5--z7; % stem and lower arm
+endchar;
+
+beginpunkchar(339,18,1,2); % \oe
+z1=pp(.5w,h); z2=pp(u,.4h); z3=pp(.5w,0);
+pd z1; draw z1..z2..{right}z3; % bowl
+z4=pp(w-1.5u,h); z5=pp(w-2u,.4h); z6=pp(w-u,0);
+pd z4; pd z6; draw z4--z1--z3--z6; % arms and stem
+pd z5; draw z5--.4[z3,z1]; % crossbar
+endchar;
+
+beginpunkchar(248,14,1,1); % \o
+z1=pp(.5w,h); z2=pp(u,.5h); z3=pp(.5w,0); z4=pp(w-u,.5h);
+z5=pp(w-2u,1.1h); z6=pp(2u,-.1h);
+pd z1; pd z6; draw z1..z2..z3..z4..z5--z6; % bowl and diagonal
+endchar;
+
+revert_punk_lower;
+
+beginpunkchar("_",12,.5,.5); % _
+z1=pp(0,-.2h); z2=pp(w,-.2h); pd z1; pd z2; draw z1--z2; % bar
+endchar;
+
+beginpunkchar("^",12,1,.5); %
+z1=pp(.5w,h); z2=pp(1.5u,.6h); z3=pp(w-1.5u,.6h);
+pd z2; pd z3; draw z2--z1--z3;
+endchar;
diff --git a/Master/texmf-dist/metapost/context/font/punkfont-definitions.mp b/Master/texmf-dist/metapost/context/font/punkfont-definitions.mp
new file mode 100644
index 00000000000..2901a9d0312
--- /dev/null
+++ b/Master/texmf-dist/metapost/context/font/punkfont-definitions.mp
@@ -0,0 +1,115 @@
+% Remark:
+%
+% This file is a merge of the original punk files by Donald Knuth, who
+% added this comment:
+%
+% Font inspired by Gerard and Marjan Unger's lectures, Feb 1985
+%
+% The regular punk files are part of TeXLive and in metafont format. All
+% errors introduced are ours. We also changed the encoding to unicode. In
+% due time we might add a few more more characters. We still need to
+% improve some of the metrics which involves a bit of trial and error. The
+% font just covers basic latin shapes but in ConTeXt MkIV we add virtual
+% composed shapes. There is a module m-punk.tex that implements this. This
+% derivate is also used in mk.tex (mk.pdf) which is one of our tests for
+% LuaTeX. We published an article on it in the MAPS (NTG magazine).
+%
+% 2008, Taco Hoekwater & Hans Hagen
+
+if unknown punk_font_loaded :
+
+ if unknown scale_factor :
+ scale_factor := 1 ;
+ fi ;
+
+ boolean punk_font_loaded ;
+
+ punk_font_loaded := true ;
+ warningcheck := 0 ;
+ proofing := 0 ;
+ designsize := 10pt#;
+ font_identifier := "Punk Nova" ; % dedicated to Don Knuth and Hermann Zapf
+
+ ht# := 7pt# ; % height of characters
+ u# := 1/4pt# ; % unit width
+ dev# := .3pt# ; % standard deviation of punk points
+
+ if known bold_punk :
+ s# := 1.2pt# ; % extra sidebar
+ px# := 1pt# ; % horizontal thickness of pen
+ py# := .8pt# ; % vertical thickness of pen
+ dot# := 1.7pt# ; % diameter of dots
+ else :
+ s# := 0 ; % extra sidebar, ok
+ px# := .6pt# ; % horizontal thickness of pen
+ py# := .5pt# ; % vertical thickness of pen
+ dot# := 1.3pt# ; % diameter of dots
+ fi ;
+
+ pt := .1pt ;
+ mag := scale_factor * 10 ;
+ bp_per_pixel := bpppix_ * mag ;
+
+ define_pixels(u,dev) ;
+ define_blacker_pixels(px,py,dot) ;
+ define_whole_pixels(s) ;
+ xoffset := s ;
+
+ pickup pencircle xscaled px yscaled py ;
+ punk_pen := savepen ;
+ pickup pencircle scaled dot ;
+ path dot_pen_path ;
+ dot_pen_path := tensepath makepath currentpen ;
+
+ defaultcolormodel := 1 ;
+
+ if known slanted_punk :
+ dot_pen_path := dot_pen_path slanted -0.25 ;
+ extra_endchar := extra_endchar & "currentpicture := currentpicture slanted 0.25 ;" ;
+ fi ;
+
+
+ def beginpunkchar(expr c,n,h,v) = % code $c$; width is $n$ units
+ hdev := h * dev ; % modify horizontal amounts of deviation
+ vdev := v * dev ; % modify vertical amounts of deviation
+ beginchar(c,n*u#,ht#,0) ;
+ italcorr 0 ;
+ % italcorr ht#*slant;
+ pickup punk_pen
+ enddef ;
+
+ def ^ =
+ transformed currenttransform
+ enddef ;
+
+ def makebox(text rule) =
+ for y=0, h : % horizontals
+ rule((-s,y)^,(w-s,y)^) ;
+ endfor
+ for x=-s, 0, w-2s, w-s : % verticals
+ rule((x,0)^,(x,h)^) ;
+ endfor
+ enddef ;
+
+ rulepen := pensquare ;
+
+ vardef pp expr z =
+ z + (hdev * normaldeviate, vdev * normaldeviate)
+ enddef;
+
+ def pd expr z = % {\bf drawdot}
+ addto currentpicture contour dot_pen_path shifted z.t_ % withpen penspeck
+ enddef;
+
+ def initialize_punk_upper =
+ ht# := 7pt# ; dev# := .3pt# ;
+ enddef ;
+ def initialize_punk_lower =
+ sht# := ht#; sdev := dev;
+ ht# := .6ht# ; dev := .7dev ;
+ enddef ;
+ def revert_punk_lower =
+ ht# := sht#; dev := sdev;
+ enddef ;
+
+fi ;
diff --git a/Master/texmf-dist/metapost/context/font/punkfont-slanted.mp b/Master/texmf-dist/metapost/context/font/punkfont-slanted.mp
new file mode 100644
index 00000000000..5c1ff46b233
--- /dev/null
+++ b/Master/texmf-dist/metapost/context/font/punkfont-slanted.mp
@@ -0,0 +1,4 @@
+boolean slanted_punk ; slanted_punk := true ;
+
+input "punkfont-definitions.mp" ;
+input "punkfont-characters.mp" ;
diff --git a/Master/texmf-dist/metapost/context/font/punkfont.mp b/Master/texmf-dist/metapost/context/font/punkfont.mp
index e57499859c8..2a03aae81df 100644
--- a/Master/texmf-dist/metapost/context/font/punkfont.mp
+++ b/Master/texmf-dist/metapost/context/font/punkfont.mp
@@ -1,863 +1,2 @@
-% Remark:
-%
-% This file is a merge of the original punk files by Donald Knuth, who
-% added this comment:
-%
-% Font inspired by Gerard and Marjan Unger's lectures,
-% Feb 1985
-%
-% The regular punk files are part of TeXLive and in metafont format. All
-% errors introduced are ours. We also changed the encoding to unicode. In
-% due time we might add a few more more characters. We still need to
-% improve some of the metrics which involves a bit of trial and error. The
-% font just covers basic latin shapes but in ConTeXt MkIV we add virtual
-% composed shapes. There is a module m-punk.tex that implements this. This
-% derivate is also used in mk.tex (mk.pdf) which is one of our tests for
-% LuaTeX. We published an article on it in the MAPS (NTG magazine).
-%
-% 2008, Taco Hoekwater & Hans Hagen
-
-if unknown punk_font_loaded :
-
- if unknown scale_factor :
- scale_factor := 1 ;
- fi ;
-
- boolean punk_font_loaded ;
-
- punk_font_loaded := true ;
- warningcheck := 0 ;
- designsize := 10pt#;
- font_identifier := "Punk Nova" ; % dedicated to Don Knuth and Hermann Zapf
-
- ht# := 7pt# ; % height of characters
- u# := 1/4pt# ; % unit width
- % s# := 1.2pt# ; % extra sidebar
- % s# := 0.1pt# ; % extra sidebar, needed because we use the bbox currently
- s# := 0 ; % extra sidebar, ok
-% s# := 1.2pt# ; % extra sidebar
- px# := .6pt# ; % horizontal thickness of pen
- py# := .5pt# ; % vertical thickness of pen
- dot# := 1.3pt# ; % diameter of dots
- dev# := .3pt# ; % standard deviation of punk points
-
- % dot# := .8pt# ; % diameter of dots
- % px# := .3pt# ; % horizontal thickness of pen
- % py# := .2pt# ; % vertical thickness of pen
-
- % seed := sqrt2 ;
- % randomseed := seed ;
- proofing := 0 ;
- pt := .1pt ;
- mag := scale_factor * 10 ;
- bp_per_pixel := bpppix_ * mag ;
-
- define_pixels(u,dev) ;
- define_blacker_pixels(px,py,dot) ;
- define_whole_pixels(s) ;
- xoffset := s ;
-
- pickup pencircle xscaled px yscaled py ;
- punk_pen := savepen ;
- pickup pencircle scaled dot ;
- path dot_pen_path ;
- dot_pen_path := tensepath makepath currentpen ;
-
-% px# := .8pt# ; % horizontal thickness of pen
-% define_pixels(u,dev) ;
-% define_blacker_pixels(px,py,dot) ;
-% pickup pencircle xscaled 1.25px yscaled 1.25py ;
-% punk_pen := savepen ;
-% pickup pencircle scaled 1.25dot ;
-% path dot_pen_path ;
-% dot_pen_path := tensepath makepath currentpen ;
-
- defaultcolormodel := 1 ;
-
- def beginpunkchar(expr c,n,h,v) = % code $c$; width is $n$ units
- hdev := h * dev ; % modify horizontal amounts of deviation
- vdev := v * dev ; % modify vertical amounts of deviation
- beginchar(c,n*u#,ht#,0) ;
- italcorr 0 ;
- % italcorr ht#*slant;
- pickup punk_pen
- enddef ;
-
-% extra_endchar := extra_endchar & "w := w+2s ; charwd := charwd+2s# ;" ;
-% extra_endchar := extra_endchar & "setbounds currentpicture to (0,-d)--(w*1.2,-d)--(w*1.2,h)--(0,h)--cycle;" ;
-
-% extra_endchar := extra_endchar & "w := w+2s ; " ;
-% extra_endchar := extra_endchar & "w := 1.2w ; " ;
-% extra_endchar := extra_endchar & "charwd := 1.2charwd ; " ;
-% extra_endchar := extra_endchar & "setbounds currentpicture to (0,-d)--(w,-d)--(w,h)--(0,h)--cycle;" ;
-
-% todo:
-
-% extra_endchar := extra_endchar &
-% "currentpicture := currentpicture shifted (0,1pt#) ; setbounds currentpicture to " &
-% "llcorner currentpicture shifted ( 0,-1pt#) -- lrcorner currentpicture shifted ( 1pt#,-1pt#) -- " &
-% "urcorner currentpicture shifted ( 1pt#, 1pt#) -- ulcorner currentpicture shifted ( 0, 1pt#) -- cycle ; " ;
-
- def ^ =
- transformed currenttransform
- enddef ;
-
- def makebox(text rule) =
- for y=0, h : % horizontals
- rule((-s,y)^,(w-s,y)^) ;
- endfor
- for x=-s, 0, w-2s, w-s : % verticals
- rule((x,0)^,(x,h)^) ;
- endfor
- enddef ;
-
- rulepen := pensquare ;
-
- vardef pp expr z =
- z + (hdev * normaldeviate, vdev * normaldeviate)
- enddef;
-
- def pd expr z = % {\bf drawdot}
- addto currentpicture contour dot_pen_path shifted z.t_ withpen penspeck
- enddef;
-
- def initialize_punk_upper =
- ht# := 7pt# ; dev# := .3pt# ;
- enddef ;
- def initialize_punk_lower =
- sht# := ht#; sdev := dev;
- ht# := .6ht# ; dev := .7dev ;
- enddef ;
- def revert_punk_lower =
- ht# := sht#; dev := sdev;
- enddef ;
-
-fi ;
-
-
-initialize_punk_upper ;
-
-beginpunkchar("A",13,1,2);
-z1=pp(1.5u,0); z2=(.5w,1.1h); z3=pp(w-1.5u,0);
-pd z1; pd z3; draw z1--z2--z3; % left and right diagonals
-z4=pp .3[z1,z2]; z5=pp .3[z3,z2]; pd z4; pd z5; draw z4--z5; % crossbar
-endchar;
-
-beginpunkchar("B",12,1,1);
-z1=pp(2u,0); z2=pp(2u,.6h); z3=pp(2u,h); pd z1; pd z3; draw z1--z3; % stem
-z1.5=pp(w-u,.5y2); z2.5=pp(w-u,.5[y2,y3]); draw z2--z2.5--z3; % upper lobe
-draw flex(z2,z1.5,z1); % lower lobe
-endchar;
-
-beginpunkchar("C",13,1,2);
-z1=pp(w-2u,.8h); z2=pp(.6w,h); z3=pp(u,.5h); z4=(.6w,0); z5=(w-2u,.2h);
-pd z1; pd z5; draw z1..z2..z3..z4..z5; % arc
-endchar;
-
-beginpunkchar("D",14,1,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-u,.6h);
-pd z1; pd z2; draw flex(z1,z3,z2); % lobe
-draw z1--z2; % stem
-endchar;
-
-beginpunkchar("E",12,.5,1);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2.5u,h); z4=pp(w-2u,0);
-pd z3; pd z4; draw z4--z1--z2--z3; % stem and arms
-z5=pp(2u,.6h); z6=pp(w-3u,.6h); pd z5; pd z6; draw z5--z6; % crossbar
-endchar;
-
-beginpunkchar("F",12,.5,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,h);
-pd z1; pd z3; draw z1--z2--z3; % stem and arm
-z5=pp(2u,.6h); z6=pp(w-3u,.6h); z4=pp .5[z5,z6]-(0,.1h);
-pd z5; pd z6; draw flex (z5,z4,z6); % crossbar
-endchar;
-
-beginpunkchar("G",13,.5,.5);
-z1=pp(w-2u,.8h); z2=pp(.6w,h); z3=pp(u,.5h); z4=pp(.6w,0); z5=(w-2u,0);
-pd z1; draw z1..z2..z3..z4---z5; % arc
-z6=pp(.5[u,x5],.4h); pd z6; pd z5; draw z6--(pp(x5,y6))--z5; % spur
-endchar;
-
-beginpunkchar("H",14,1,.5);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,0); z4=pp(w-2u,h);
-z5=pp(2u,.6h); z6=pp(w-2u,.6h);
-pd z1; pd z2; pd z3; pd z4; draw z1--z2; draw flex(z3,z6,z4); % stems
-pd z5; draw z5--z6; % crossbar
-endchar;
-
-beginpunkchar("I",5,1,2);
-z1=pp(.5w,0); z2=(.5w,1/3h); z3=(.5w,2/3h); z4=(.5w,h);
-pd z1; pd z4; draw flex(z1,z2,z3,z4); % stem
-endchar;
-
-beginpunkchar("J",9,1,2);
-z1=pp(w-2u,h); z2=pp(w-2u,-.1h); z3=pp(u,0);
-pd z1; pd z3; draw z1--z2--z3; % arc
-endchar;
-
-beginpunkchar("K",14,1,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(2u,1/3h); z4=pp(w-1.5u,h);
-pd z1; pd z2; draw z1--z2; % stem
-pd z3; pd z4; draw z3--z4; % upper diagonal
-z6=pp(w-u,0); z5=1/3[z3,z4];
-pd z6; draw flex(z5,.8[z1,2/3[z5,z6] ],z6);% lower diagonal
-endchar;
-
-beginpunkchar("L",11,1,2);
-z1=pp(2u,h); z2=pp(2u,0); z3=pp(w-1.5u,0);
-pd z1; pd z3; draw z1--z2--z3; % stem and arm
-endchar;
-
-beginpunkchar("M",17,.5,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(.5w,0); z4=pp(w-2u,h); z5=pp(w-2u,0);
-pd z1; pd z5; draw z1--z2--z3--z4--z5; % stems and diagonals
-endchar;
-
-beginpunkchar("N",13,.75,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,0); z4=pp(w-2u,h);
-pd z1; pd z4; draw z1--z2--z3--z4; % stems and diagonals
-endchar;
-
-beginpunkchar("O",12,.5,2);
-z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
-pd z1; draw z1{left}..z2..z3..z4..z1; % bowl
-endchar;
-
-beginpunkchar("P",13,1,2);
-z1=pp(2u,0); z2=pp(2u,1.1h); z3=pp(2u,.5h); z4=pp(w,.6[y3,y2]);
-pd z1; pd z3; draw z1--z2--z4--z3; % stem and bowl
-endchar;
-
-beginpunkchar("Q",14,.5,2);
-z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
-pd z1; draw z1{curl 2}..z2..z3..z4..z1; % bowl
-z5=pp(.4w,.2h); z6=pp(w-u,-.1h); z7=pp(.5[x5,x6],-.2h);
-pd z5; pd z6; draw z5--z7--z6; % tail
-endchar;
-
-beginpunkchar("R",16,1,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-u,.6[y2,y4]); z4=pp(2u,.5h); z5=pp(w-1.5u,0);
-pd z1; pd z2; pd z5; draw z1--flex(z2,z3,z4)--z5; % stem, bowl, and diagonal
-endchar;
-
-beginpunkchar("S",11,.3,1);
-z1=pp(w-2u,.9h); z2=pp(.5w,h); z3=pp(u,.7h); z4=.6[z6,z2];
-z5=pp(w-u,.35h); z6=pp(.5w,u); z7=pp(u,.2h);
-pd z1; pd z7; draw z1--z2...z3..z4..z5...z6--z7; % stroke
-endchar;
-
-beginpunkchar("T",13,.75,2);
-z1=pp(u,h); z2=pp(w-u,h); z3=pp(.5w,0);
-pd z1; pd z2; pd z3; draw z1--z2; % arms
-draw .5[z1,z2]--z3; % stem
-endchar;
-
-beginpunkchar("U",13,.3,2);
-z1=pp(2u,h); z2=pp(2u,.2h); z3=pp(.5w,0); z4=pp(w-2u,.2h); z5=pp(w-2u,h);
-pd z1; pd z5; draw z1---z2...z3{z4-z2}...z4---z5; % stroke
-endchar;
-
-beginpunkchar("V",13,1,2);
-z1=pp(1.5u,h); z2=pp(.5w,0); z3=pp(w-1.5u,h);
-pd z1; pd z3; draw z1--z2--z3; % diagonals
-endchar;
-
-beginpunkchar("W",18,1,2);
-z1=pp(1.5u,h); z2=pp(.5[x1,x3],0); z3=pp(.5w,.8h); z4=pp(.5[x3,x5],0);
-z5=pp(w-1.5u,h);
-pd z1; pd z5; draw z1--z2--z3--z4--z5; % diagonals
-endchar;
-
-beginpunkchar("X",13,1,1);
-z1=pp(1.5u,h); z2=pp(w-1.5u,0); z3=pp(1.5u,0); z4=pp(w-2.5u,h);
-pd z1; pd z2; draw z1--z2; % main diagonal
-pd z3; pd z4; draw z3--z4; % cross diagonal
-endchar;
-
-beginpunkchar("Y",13,1,2);
-z1=pp(1.5u,h); z2=pp(w-1.5u,h); z3=pp(.5w,.5h); z4=pp(.5w,0);
-pd z1; pd z2; pd z4; draw z1--z3--z4; % stem and left diagonal
-draw z2--z3; % right diagonal
-endchar;
-
-beginpunkchar("Z",11,1,2);
-z1=pp(1.5u,h); z2=pp(w-2.5u,h); z3=pp(1.5u,0); z4=pp(w-1.5u,0);
-pd z1; pd z4; draw z1--z2--z3--z4; % diagonals
-endchar;
-
-beginpunkchar(198,16,1,2); % \AE
-z1=pp(1.5u,0); z2=pp(.6w,h); z3=pp(w-1.5u,h);
-pd z1; pd z3; draw z1--z2--z3; % left diagonal and upper arm
-z4=pp .3[z1,z2]; z5=pp(.6w,0); z6=pp(w-2u,.3h);
-pd z4; pd z6; draw z4--z6; % crossbar
-z7=pp(w-u,0); pd z2; pd z7; draw z2--z5--z7; % stem and lower arm
-endchar;
-
-beginpunkchar(338,18,1,2); % \OE
-z1=pp(.5w,h); z2=pp(u,.4h); z3=pp(.5w,0);
-pd z1; draw z1..z2..{right}z3; % bowl
-z4=pp(w-1.5u,h); z5=pp(w-2u,.4h); z6=pp(w-u,0);
-pd z4; pd z6; draw z4--z1--z3--z6; % arms and stem
-pd z5; draw z5--.4[z3,z1]; % crossbar
-endchar;
-
-beginpunkchar(216,14,1,1); % \O
-z1=pp(.5w,h); z2=pp(u,.5h); z3=pp(.5w,0); z4=pp(w-u,.5h);
-z5=pp(w-2u,1.1h); z6=pp(2u,-.1h);
-pd z1; pd z6; draw z1..z2..z3..z4..z5--z6; % bowl and diagonal
-endchar;
-
-beginpunkchar(915,11,1,2); % $\Gamma$
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-1.5u,h);
-pd z1; pd z3; draw z1--z2--z3; % stem and arm
-endchar;
-
-beginpunkchar(916,15,1,2); % $\Delta$
-z1=pp(u,0); z2=pp(.5w,h); z3=pp(w-u,0);
-pd z1; draw z1--z2..tension 5..z3..tension 5..z1; % triangle
-endchar;
-
-beginpunkchar(920,15,.5,2); % $\Theta$
-z1=pp(.5w,h); z2=pp(u,.6h); z3=pp(.5w,0); z4=pp(w-u,.6h);
-pd z1; draw z1..tension.8..z2..z3..z4..tension.8..z1; % bowl
-z5=pp(x2+2u,.4h); z6=pp(x4-2u,.4h); pd z5; pd z6; draw z5--z6; % bar
-endchar;
-
-beginpunkchar(923,12,1,2); % $\Lambda$
-z1=pp(u,0); z2=pp(.5w,h); z3=pp(w-u,0);
-pd z1; pd z3; draw z1--z2--z3; % diagonals
-endchar;
-
-beginpunkchar(926,12,1,1); % $\Xi$
-z1=pp(u,h); z2=pp(w-u,h); pd z1; pd z2; draw z1--z2; % upper arm
-z3=pp(2u,.55h); z4=pp(w-2u,.55h); pd z3; pd z4; draw z3--z4; % bar
-z5=pp(u,0); z6=pp(w-u,0); pd z5; pd z6; draw z5--z6; % lower arm
-endchar;
-
-beginpunkchar(928,13,1,.5); % $\Pi$
-z1=pp(1.5u,0); z2=pp(1.5u,h); z3=pp(w-1.5u,h); z4=pp(w-1.5u,0);
-pd z1; pd z4; draw z1--z2--z3--z4; % stems and bar
-endchar;
-
-beginpunkchar(931,13,1,1); % $\Sigma$
-z1=pp(w-u,h); z2=pp(u,h); z3=pp(.5w-u,.5h); z4=pp(u,0); z5=pp(w-u,0);
-pd z1; pd z5; draw z1--z2{.5[z4,z5]-z2}..z3--z4--z5; % arms and diagonals
-endchar;
-
-beginpunkchar(933,15,1,.5); % $\Upsilon$
-z1=pp(u,.8h); z2=pp(.3w,h); z3=pp(.5w,.5h); z4=pp(.5w,0);
-pd z1; pd z4; draw z1..z2..tension2..z3---z4; % left arc and stem
-z5=pp(w-u,.8h); z6=pp(.7w,h);
-pd z5; draw z5..z6..tension2..{z4-z3}z3; % right arc
-endchar;
-
-beginpunkchar(934,13,1,2); % $\Phi$
-z1=pp(.5w,h); z2=pp(.5w,0); pd z1; pd z2; draw z1--z2; % stem
-z3=pp(.5w,2/3h); z4=pp(u,.5h); z5=pp(.5w,1/4h); z6=pp(w-u,.5h);
-pd z3; draw z3..z4..z5..z6..z3; % bowl
-endchar;
-
-beginpunkchar(936,14,1,1); % $\Psi$
-z1=pp(.5w,h); z2=pp(.5w,0); pd z1; pd z2; draw z1--z2; % stem
-z3=pp(u,.8h); z4=pp(.5w,.2h); z5=pp(w-u,.8h);
-pd z3; pd z5; draw z3{.4[z1,z2]-z3}..z4{right}..{z5-.4[z1,z2]}z5; % stroke
-endchar;
-
-beginpunkchar(937,13,1,2); % $\Omega$
-z1=pp(u,0); z2=pp(1/3w,0); z3=pp(u,2/3h); z4=pp(.5w,h);
-z5=pp(w-u,2/3h); z6=pp(2/3w,0); z7=pp(w-u,0);
-pd z1; pd z7; draw z1--z2{up}..z3..z4..z5..{down}z6--z7; % bowl and arms
-endchar;
-
-beginpunkchar(".",5,1,2);
-pd pp(.5w,0); % dot
-endchar;
-
-beginpunkchar(",",5,.5,.5);
-z1=pp(.5w,0); z2=pp(w-u,-.1h); z3=pp(.5w,-.3h);
-pd z1; pd z3; draw z1--z2--z3; % stroke
-endchar;
-
-beginpunkchar(":",5,1,.5);
-pd pp(.5w,0); pd pp(.5w,.4h); % dots
-endchar;
-
-beginpunkchar(";",5,.5,.5);
-z1=pp(.5w,0); z2=pp(w-u,-.1h); z3=pp(.5w,-.3h);
-pd z1; pd z3; draw z1--z2--z3; % stroke
-pd pp(.5w,.4h); % dot
-endchar;
-
-beginpunkchar("!",5,.5,.5);
-pd pp(.5w,0); % dot
-z1=pp(.5w,1.05h); z2=pp(.5w,.3h); pd z1; pd z2; draw z1--z2; % stem
-endchar;
-
-beginpunkchar(161,5,.5,.5); % spanish inverted !
-pd pp(.5w,.9h); % dot
-z1=pp(.5w,-.1h); z2=pp(.5w,.6h); pd z1; pd z2; draw z1--z2; % stem
-endchar;
-
-beginpunkchar("?",9,1,.5);
-z1=pp(1.5u,.8h); z2=pp(.5w,h); z3=pp(w-u,.8h); z4=pp(.5w,.3h);
-pd z1; pd z4; draw z1..z2..z3..{down}z4; % arc and stem
-pd pp(.5w,0); % dot
-endchar;
-
-beginpunkchar(191,9,1,.5); % spanish inverted ?
-z1=pp(1.5u,.1h); z2=pp(.5w,-.1h); z3=pp(w-u,.1h); z4=pp(.5w,.6h);
-pd z1; pd z4; draw z1..z2..z3..{up}z4; % arc and stem
-pd pp(.5w,.9h); % dot
-endchar;
-
-beginpunkchar("&",14,.5,.5);
-z1=pp(w-2u,h); z2=pp(u,h); z3=pp(3u,0); z5=pp(w-u,.6h); z6=pp(w-2u,0);
-pd z1; pd z5; draw z1--z2--z3--z5; % arms and stem
-draw z1--.5[z2,z3]; pd z6; draw z6--.6[z3,z5]; % diagonals
-endchar;
-
-beginpunkchar("$",12,.5,.5);
-z1=pp(w-1.5u,.7h); z2=pp(.5w,h); z3=pp(u,.7h); z4=.5[z3,z5];
-z5=pp(w-u,.3h); z6=pp(.5w,0); z7=pp(u,.3h);
-pd z1; pd z7; draw z1..z2..z3..z4..z5..z6..z7; % stroke
-z8=z2+(0,.1h); pd z8; draw z8--z6; % stem
-endchar;
-
-beginpunkchar("%",18,.5,.5);
-z1=pp(3.5u,1.1h); z2=pp(u,.8h); z3=pp(3.5u,.5h); z4=pp(6u,.8h);
-z5=pp(w-3.5u,.5h); z6=pp(w-6u,.2h); z7=pp(w-3.5u,-.1h); z8=pp(w-u,.2h);
-pd z1; draw z1..z2..z3..z4..z1; % upper bowl
-pd z5; draw z5..z6..z7..z8..z5; % lower bowl
-z9=pp(w-3u,1.1h); z0=pp(3u,-.1h); pd z0; draw z9--z0; % diagonal
-draw z1{z5-z1}..z9; % link
-endchar;
-
-beginpunkchar("@",18,1,.5);
-z1=pp(2u,0); z2=pp(1/3w,.7h); z3=pp(w-6u,0);
-z4=pp(w,.3h); z5=pp(1/3w,h); z6=pp(u,.5h); z7=.7[z2,z3];
-pd z1; pd z7; draw z1--z2--z3{right}..z4..z5..z6..z7; % diagonals and stroke
-endchar;
-
-beginpunkchar("-",7,.5,.5);
-z1=pp(u,.4h); z2=pp(w-u,.5h); pd z1; pd z2; draw z1--z2; % bar
-endchar;
-
-beginpunkchar(8211,9,.5,.5); % --
-z1=pp(0,.5h); z2=pp(w,.4h); pd z1; pd z2; draw z1--z2; % bar
-endchar;
-
-beginpunkchar(8212,18,.5,.5); % ---
-z1=pp(0,.5h); z2=pp(w,.4h); pd z1; pd z2; draw z1--z2; % bar
-endchar;
-
-beginpunkchar("+",9,.5,1);
-z1=pp(0,.5h); z2=pp(w,.5h); pd z1; pd z2; draw z1--z2; % bar
-z3=pp(.5w,.1h); z4=pp(.5w,.9h); pd z3; pd z4; draw z3--z4; % stem
-endchar;
-
-beginpunkchar("*",13,.5,1);
-z0=pp(.5w,1.1h); z1=pp(u,.9h); z2=pp(2u,.3h); z3=pp(w-u,.3h); z4=pp(w-u,.9h);
-pd z0; draw z0--z2..1/3[.5[z2,z4],z0]..z4--z1--z3--z0; % star
-endchar;
-
-beginpunkchar(39,5,.5,1.5); % ' apostrofe HH/TH (to be checked)
-z1=pp(w/2,h); z2=pp(w/2+u,.85h); z3=pp(w/2,2/3h);
-pd z1; pd z3; draw z1..z2..z3; % stroke
-endchar;
-
-beginpunkchar(34,9,1,1.5); % " HH/TH (to be checked)
-z1=pp(1.5u,h); z2=pp(1.5u,.6h); z3=pp(w-1.5u,h); z4=pp(w-1.5u,.6h);
-pd z1; pd z2; pd z3; pd z4; draw z1--z2; draw z3--z4;
-endchar;
-
-beginpunkchar(8216,5,.3,.5); % `
-z1=pp(w-1.5u,h); z2=pp(u,.85h); z3=pp(w-u,2/3h);
-pd z1; pd z3; draw z1--z2--z3; % stroke
-endchar;
-
-beginpunkchar(8217,5,.3,.5); % '
-z1=pp(1.5u,h); z2=pp(w-u,.85h); z3=pp(u,2/3h);
-pd z1; pd z3; draw z1--z2--z3; % stroke
-endchar;
-
-beginpunkchar(8220,9,.3,.5); % `` quotedblleft
-z1=pp(.5w+.5u,h); z2=pp(w-u,.6h); z3=pp(u,.95h);
-pd z1; pd z3; draw z1--z2--z3; % stroke
-endchar;
-
-beginpunkchar(8221,9,.3,.5); % '' quotedblright
-z1=pp(.5w-.5u,h); z2=pp(u,.6h); z3=pp(w-u,.95h);
-pd z1; pd z3; draw z1--z2--z3; % stroke
-endchar;
-
-beginpunkchar("(",7,.5,.5);
-z1=pp(w-u,h); z2=pp(u,.5h); z3=pp(w-u,0);
-pd z1; pd z3; draw z1..z2..z3; % stroke
-endchar;
-
-beginpunkchar(")",7,.5,.5);
-z1=pp(u,h); z2=pp(w-u,.5h); z3=pp(u,0); pd z1; pd z3; draw z1..z2..z3; % stroke
-endchar;
-
-beginpunkchar("[",8,.5,.5);
-z1=pp(w-u,h); z2=pp(.5w,h); z3=pp(.5w,0); z4=pp(w-u,0);
-pd z1; pd z4; draw z1--z2--z3--z4; % bars and stem
-endchar;
-
-beginpunkchar("]",8,.5,.5);
-z1=pp(u,h); z2=pp(.5w,h); z3=pp(.5w,0); z4=pp(u,0);
-pd z1; pd z4; draw z1--z2--z3--z4; % bars and stem
-endchar;
-
-beginpunkchar("<",9,.5,.5);
-z1=pp(w-u,.9h); z2=pp(u,.5h); z3=pp(w-u,.1h);
-pd z1; pd z3; draw z1--z2--z3; % diagonals
-endchar;
-
-beginpunkchar(">",9,.5,.5);
-z1=pp(u,.9h); z2=pp(w-u,.5h); z3=pp(u,.1h);
-pd z1; pd z3; draw z1--z2--z3; % diagonals
-endchar;
-
-beginpunkchar("{",10,.5,.5); % HH/TH
-z1=pp(w-2u,h); z3=pp(2u,.5h); z5=pp(w-2u,0);
-z2=pp(w-4u,.6h); z4=(w-4u,.4h);
-pd z1; pd z3; pd z5; draw z1{left}..z2--z3 & z3--z4..{right}z5;
-endchar;
-
-beginpunkchar("}",10,.5,.5); % HH/TH
-z1=pp(2u,h); z3=pp(w-2u,.5h); z5=pp(2u,0);
-z2=pp(4u,.6h); z4=(4u,.4h);
-pd z1; pd z3; pd z5; draw z1{right}..z2--z3 & z3--z4..{left}z5;
-endchar;
-
-beginpunkchar("=",9,.5,.5);
-z5=pp(u,2/3h); z6=pp(w-u,2/3h); pd z5; pd z6; draw z5--z6; % upper bar
-z7=pp(u,1/3h); z8=pp(w-u,1/3h); pd z7; pd z8; draw z7--z8; % lower bar
-endchar;
-
-beginpunkchar("#",15,.5,.5);
-z1=pp(.5w,h); z2=pp(3u,0); z3=pp(w-3u,h); z4=pp(.5w,0);
-pd z2; pd z3; draw z3--z1--z2; draw z3--z4--z2; % diagonals (linked)
-z5=pp(u,2/3h); z6=pp(w-u,2/3h); pd z5; pd z6; draw z5--z6; % upper bar
-z7=pp(u,1/3h); z8=pp(w-u,1/3h); pd z7; pd z8; draw z7--z8; % lower bar
-endchar;
-
-beginpunkchar("/",9,1,1);
-z1=pp(1.5u,-.05h); z2=pp(w-1.5u,1.05h); pd z1; pd z2; draw z1--z2; % diagonal
-endchar;
-
-beginpunkchar("\",9,1,1); % HH/TH
-z1=pp(1.5u,1.05h); z2=pp(w-1.5u,-.05h); pd z1; pd z2; draw z1--z2; % reverse diagonal
-endchar;
-
-
-beginpunkchar("0",9,.5,1);
-z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
-pd z1; draw z1{curl 2}..z2..z3..z4..z1; % bowl
-endchar;
-
-beginpunkchar("1",9,.3,1);
-z1=pp(2u,.7h); z2=pp(.6w,h); z3=pp(.6w,0);
-pd z1; pd z3; draw z1--z2--z3; % serif and stem
-endchar;
-
-beginpunkchar("2",9,1,1);
-z1=pp(2u,.7h); z2=pp(.5w,h); z3=pp(w-u,.6h); z4=pp(u,0); z5=pp(w-2u,0);
-pd z1; pd z5; draw z1..z2..z3..z4--z5; % stroke
-endchar;
-
-beginpunkchar("3",9,.5,.5);
-z1=pp(2u,.7h); z2=pp(.5w,h); z3=pp(w-u,.5[y2,y4]);
-z4=pp(.5w-u,.55h); z5=pp(w-u,.5[y4,y6]); z6=pp(.5w,0); z7=pp(1.5u,.2h);
-pd z1; pd z7; draw z1..z2..z3..z4&z4..z5..z6..z7; % arcs
-endchar;
-
-beginpunkchar("4",9,1,1);
-z1=pp(w-u,.3h); z2=pp(u,.3h); z3=pp(2/3w,h); z4=pp(2/3w,0);
-pd z1; pd z4; draw z1--z2--z3--z4; % stem and diagonals
-endchar;
-
-beginpunkchar("5",9,.5,.5);
-z1=pp(w-2u,h); z2=pp(2u,h); z3=pp(u,.7h); z4=pp(w-u,.5[y3,y5]);
-z5=pp(.5w,0); z6=pp(u,.2h);
-pd z1; pd z6; draw z1--z2--z3..z4..z5..z6; % stroke
-endchar;
-
-beginpunkchar("6",9,1,1);
-z1=pp(2/3w,h); z2=pp(u,.3h); z3=pp(.5w,0); z4=pp(w-u,.3h); z5=pp(.6w,.6h);
-z6=pp z2; pd z1; pd z6; draw z1..z2..z3..z4..z5--z6; % stroke
-endchar;
-
-beginpunkchar("7",9,.5,1);
-z1=pp(2u,h); z2=pp(w-.5u,h); z3=pp(.4w,0);
-pd z1; pd z3; draw z1--z2&z2..z3{down}; % stroke
-endchar;
-
-beginpunkchar("8",9,.5,.5);
-z1=pp(.5w,h); z2=pp(u,.5[y1,y3]); z3=pp(.5w,.6h); z4=pp(w-u,.5[y3,y5]);
-z5=pp(.5w,0); z6=pp(u,.5[y5,y3]); z7=pp(w-u,.5[y1,y3]);
-pd z1; draw z1{curl 8}..z2..z3..z4..z5..z6..z3..z7..z1; % stroke
-endchar;
-
-beginpunkchar("9",9,1,1);
-z1=pp(1/3w,0); z2=pp(w-u,.7h); z3=pp(.5w,h); z4=pp(u,.7h); z5=pp(.5w,.4h);
-pd z1; pd z5; draw z1..z2..z3..z4..z5; % stroke
-endchar;
-
-beginpunkchar(96,9,1,1); % \`{} grave
-z1=pp(2.5u,h); z2=pp(.6w,.8h); pd z1; pd z2; draw z1--z2; % diagonal
-endchar;
-
-beginpunkchar(180,9,1,1); % \'{} acute
-z1=pp(w-2.5u,h); z2=pp(.4w,.8h); pd z1; pd z2; draw z1--z2; % diagonal
-endchar;
-
-beginpunkchar(710,13,1,1); % \^{} circumflex
-z1=pp(2.5u,.8h); z2=pp(.5w,h); z3=(w-2.5u,.8h);
-pd z1; pd z3; draw z1--z2--z3; % diagonals
-endchar;
-
-beginpunkchar(711,13,1,1); % \v{} caron
-z1=pp(2.5u,.9h); z2=pp(.5w,.7h); z3=pp(w-2.5u,.9h);
-pd z1; pd z3; draw z1--z2--z3; % diagonals
-endchar;
-
-beginpunkchar(728,11,1,1); % \u{} breve
-z1=pp(2u,h); z2=pp(.5w,.75h); z3=pp(w-2u,h);
-pd z1; pd z3; draw flex(z1,z2,z3); % stroke
-endchar;
-
-beginpunkchar(175,12,1,1); % \={} macron
-z1=pp(u,.8h); z2=pp(w-u,.8h); pd z1; pd z2; draw z1--z2; % bar
-endchar;
-
-beginpunkchar(729,5,1,1); % \.{}
-pd pp(.5w,.9h); % dot
-endchar;
-
-beginpunkchar(168,13,1,1); % \"{} diaeresis
-pd pp(1/5w,.9h); pd pp(4/5w,.9h); % dots
-endchar;
-
-beginpunkchar(732,13,1,1); % \~{} tilde
-z1=pp(u,.75h); z2=pp(w-u,.9h); pd z1; pd z2; draw z1{up}..{up}z2; % stroke
-endchar;
-
-beginpunkchar(733,13,1,1); % \H{} hungarumlaut
-z1=pp(4u,h); z2=pp(2.5u,.7h); z3=pp(w-2u,h); z4=pp(w-3.5u,.7h);
-pd z1; pd z3; draw z1--z2--z4--z3; % diagonals (linked)
-endchar;
-
-beginpunkchar(730,13,0,0); % Scandinavian loop, for \AA\ and \aa (ring)
-z0=(.5w,.66h); % point $z^2$ of lowercase A
-z1=(.5w,.9h); draw z0{z0-(1.5u,0)}..z1..{(w-1.5u,0)-z0}z0; % loop
-endchar;
-
-beginpunkchar(184,13,.5,.5); % Cedilla, for \c c
-z1=(.6w,0); z2=pp(.6w,-.1h); z3=pp(2.5u,-.1h);
-pd z3; draw z1--z2--z3; % stroke
-endchar;
-
-initialize_punk_lower ;
-
-beginpunkchar(305,5,1,2); % dotless I
-z1=pp(.5w,0); z2=(.5w,1/3h); z3=(.5w,2/3h); z4=(.5w,h);
-pd z1; pd z4; draw flex(z1,z2,z3,z4); % stem
-endchar;
-
-beginpunkchar(567,9,1,2); % dotless J
-z1=pp(w-2u,h); z2=pp(w-2u,-.1h); z3=pp(u,0);
-pd z1; pd z3; draw z1--z2--z3; % arc
-endchar;
-
-beginpunkchar(223,18,.3,1); % German SS
-z1=pp(.5w-u,.9h); z2=pp(1/3w,h); z3=pp(u,.7h); z4=.6[z6,z2];
-z5=pp(.5w,.35h); z6=pp(1/3w,u); z7=pp(u,.2h);
-pd z1; pd z7; draw z1--z2...z3..z4..z5...z6--z7; % left stroke
-for i=1 upto 7: z[i+10]=pp(z[i] shifted (.5w-u,0)); endfor
-pd z11; pd z17; draw z11--z12...z13..z14..z15...z16--z17; % right stroke
-endchar;
-
-beginpunkchar("a",13,1,2);
-z1=pp(1.5u,0); z2=(.5w,1.1h); z3=pp(w-1.5u,0);
-pd z1; pd z3; draw z1--z2--z3; % left and right diagonals
-z4=pp .3[z1,z2]; z5=pp .3[z3,z2]; pd z4; pd z5; draw z4--z5; % crossbar
-endchar;
-
-beginpunkchar("b",12,1,1);
-z1=pp(2u,0); z2=pp(2u,.6h); z3=pp(2u,h); pd z1; pd z3; draw z1--z3; % stem
-z1.5=pp(w-u,.5y2); z2.5=pp(w-u,.5[y2,y3]); draw z2--z2.5--z3; % upper lobe
-draw flex(z2,z1.5,z1); % lower lobe
-endchar;
-
-beginpunkchar("c",13,1,2);
-z1=pp(w-2u,.8h); z2=pp(.6w,h); z3=pp(u,.5h); z4=(.6w,0); z5=(w-2u,.2h);
-pd z1; pd z5; draw z1..z2..z3..z4..z5; % arc
-endchar;
-
-beginpunkchar("d",14,1,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-u,.6h);
-pd z1; pd z2; draw flex(z1,z3,z2); % lobe
-draw z1--z2; % stem
-endchar;
-
-beginpunkchar("e",12,.5,1);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2.5u,h); z4=pp(w-2u,0);
-pd z3; pd z4; draw z4--z1--z2--z3; % stem and arms
-z5=pp(2u,.6h); z6=pp(w-3u,.6h); pd z5; pd z6; draw z5--z6; % crossbar
-endchar;
-
-beginpunkchar("f",12,.5,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,h);
-pd z1; pd z3; draw z1--z2--z3; % stem and arm
-z5=pp(2u,.6h); z6=pp(w-3u,.6h); z4=pp .5[z5,z6]-(0,.1h);
-pd z5; pd z6; draw flex (z5,z4,z6); % crossbar
-endchar;
-
-beginpunkchar("g",13,.5,.5);
-z1=pp(w-2u,.8h); z2=pp(.6w,h); z3=pp(u,.5h); z4=pp(.6w,0); z5=(w-2u,0);
-pd z1; draw z1..z2..z3..z4---z5; % arc
-z6=pp(.5[u,x5],.4h); pd z6; pd z5; draw z6--(pp(x5,y6))--z5; % spur
-endchar;
-
-beginpunkchar("h",14,1,.5);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,0); z4=pp(w-2u,h);
-z5=pp(2u,.6h); z6=pp(w-2u,.6h);
-pd z1; pd z2; pd z3; pd z4; draw z1--z2; draw flex(z3,z6,z4); % stems
-pd z5; draw z5--z6; % crossbar
-endchar;
-
-beginpunkchar("i",5,1,2);
-z1=pp(.5w,0); z2=(.5w,1/3h); z3=(.5w,2/3h); z4=(.5w,h);
-pd z1; pd z4; draw flex(z1,z2,z3,z4); % stem
-endchar;
-
-beginpunkchar("j",9,1,2);
-z1=pp(w-2u,h); z2=pp(w-2u,-.1h); z3=pp(u,0);
-pd z1; pd z3; draw z1--z2--z3; % arc
-endchar;
-
-beginpunkchar("k",14,1,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(2u,1/3h); z4=pp(w-1.5u,h);
-pd z1; pd z2; draw z1--z2; % stem
-pd z3; pd z4; draw z3--z4; % upper diagonal
-z6=pp(w-u,0); z5=1/3[z3,z4];
-pd z6; draw flex(z5,.8[z1,2/3[z5,z6] ],z6);% lower diagonal
-endchar;
-
-beginpunkchar("l",11,1,2);
-z1=pp(2u,h); z2=pp(2u,0); z3=pp(w-1.5u,0);
-pd z1; pd z3; draw z1--z2--z3; % stem and arm
-endchar;
-
-beginpunkchar("m",17,.5,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(.5w,0); z4=pp(w-2u,h); z5=pp(w-2u,0);
-pd z1; pd z5; draw z1--z2--z3--z4--z5; % stems and diagonals
-endchar;
-
-beginpunkchar("n",13,.75,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-2u,0); z4=pp(w-2u,h);
-pd z1; pd z4; draw z1--z2--z3--z4; % stems and diagonals
-endchar;
-
-beginpunkchar("o",12,.5,2);
-z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
-pd z1; draw z1{left}..z2..z3..z4..z1; % bowl
-endchar;
-
-beginpunkchar("p",13,1,2);
-z1=pp(2u,0); z2=pp(2u,1.1h); z3=pp(2u,.5h); z4=pp(w,.6[y3,y2]);
-pd z1; pd z3; draw z1--z2--z4--z3; % stem and bowl
-endchar;
-
-beginpunkchar("q",14,.5,2);
-z1=pp(.5w,h); z2=pp(u,.55h); z3=pp(.5w,0); z4=pp(w-u,.55h);
-pd z1; draw z1{curl 2}..z2..z3..z4..z1; % bowl
-z5=pp(.4w,.2h); z6=pp(w-u,-.1h); z7=pp(.5[x5,x6],-.2h);
-pd z5; pd z6; draw z5--z7--z6; % tail
-endchar;
-
-beginpunkchar("r",16,1,2);
-z1=pp(2u,0); z2=pp(2u,h); z3=pp(w-u,.6[y2,y4]); z4=pp(2u,.5h); z5=pp(w-1.5u,0);
-pd z1; pd z2; pd z5; draw z1--flex(z2,z3,z4)--z5; % stem, bowl, and diagonal
-endchar;
-
-beginpunkchar("s",11,.3,1);
-z1=pp(w-2u,.9h); z2=pp(.5w,h); z3=pp(u,.7h); z4=.6[z6,z2];
-z5=pp(w-u,.35h); z6=pp(.5w,u); z7=pp(u,.2h);
-pd z1; pd z7; draw z1--z2...z3..z4..z5...z6--z7; % stroke
-endchar;
-
-beginpunkchar("t",13,.75,2);
-z1=pp(u,h); z2=pp(w-u,h); z3=pp(.5w,0);
-pd z1; pd z2; pd z3; draw z1--z2; % arms
-draw .5[z1,z2]--z3; % stem
-endchar;
-
-beginpunkchar("u",13,.3,2);
-z1=pp(2u,h); z2=pp(2u,.2h); z3=pp(.5w,0); z4=pp(w-2u,.2h); z5=pp(w-2u,h);
-pd z1; pd z5; draw z1---z2...z3{z4-z2}...z4---z5; % stroke
-endchar;
-
-beginpunkchar("v",13,1,2);
-z1=pp(1.5u,h); z2=pp(.5w,0); z3=pp(w-1.5u,h);
-pd z1; pd z3; draw z1--z2--z3; % diagonals
-endchar;
-
-beginpunkchar("w",18,1,2);
-z1=pp(1.5u,h); z2=pp(.5[x1,x3],0); z3=pp(.5w,.8h); z4=pp(.5[x3,x5],0);
-z5=pp(w-1.5u,h);
-pd z1; pd z5; draw z1--z2--z3--z4--z5; % diagonals
-endchar;
-
-beginpunkchar("x",13,1,1);
-z1=pp(1.5u,h); z2=pp(w-1.5u,0); z3=pp(1.5u,0); z4=pp(w-2.5u,h);
-pd z1; pd z2; draw z1--z2; % main diagonal
-pd z3; pd z4; draw z3--z4; % cross diagonal
-endchar;
-
-beginpunkchar("y",13,1,2);
-z1=pp(1.5u,h); z2=pp(w-1.5u,h); z3=pp(.5w,.5h); z4=pp(.5w,0);
-pd z1; pd z2; pd z4; draw z1--z3--z4; % stem and left diagonal
-draw z2--z3; % right diagonal
-endchar;
-
-beginpunkchar("z",11,1,2);
-z1=pp(1.5u,h); z2=pp(w-2.5u,h); z3=pp(1.5u,0); z4=pp(w-1.5u,0);
-pd z1; pd z4; draw z1--z2--z3--z4; % diagonals
-endchar;
-
-beginpunkchar(230,16,1,2); % \ae
-z1=pp(1.5u,0); z2=pp(.6w,h); z3=pp(w-1.5u,h);
-pd z1; pd z3; draw z1--z2--z3; % left diagonal and upper arm
-z4=pp .3[z1,z2]; z5=pp(.6w,0); z6=pp(w-2u,.3h);
-pd z4; pd z6; draw z4--z6; % crossbar
-z7=pp(w-u,0); pd z2; pd z7; draw z2--z5--z7; % stem and lower arm
-endchar;
-
-beginpunkchar(339,18,1,2); % \oe
-z1=pp(.5w,h); z2=pp(u,.4h); z3=pp(.5w,0);
-pd z1; draw z1..z2..{right}z3; % bowl
-z4=pp(w-1.5u,h); z5=pp(w-2u,.4h); z6=pp(w-u,0);
-pd z4; pd z6; draw z4--z1--z3--z6; % arms and stem
-pd z5; draw z5--.4[z3,z1]; % crossbar
-endchar;
-
-beginpunkchar(248,14,1,1); % \o
-z1=pp(.5w,h); z2=pp(u,.5h); z3=pp(.5w,0); z4=pp(w-u,.5h);
-z5=pp(w-2u,1.1h); z6=pp(2u,-.1h);
-pd z1; pd z6; draw z1..z2..z3..z4..z5--z6; % bowl and diagonal
-endchar;
-
-revert_punk_lower;
-
-beginpunkchar("_",12,.5,.5); % _
-z1=pp(0,-.2h); z2=pp(w,-.2h); pd z1; pd z2; draw z1--z2; % bar
-endchar;
-
-beginpunkchar("^",12,1,.5); %
-z1=pp(.5w,h); z2=pp(1.5u,.6h); z3=pp(w-1.5u,.6h);
-pd z2; pd z3; draw z2--z1--z3;
-endchar;
+input "punkfont-definitions.mp" ;
+input "punkfont-characters.mp" ;