% Digits for Gislet % Author: Bert Bos % Date: 22 Oct 1990 numwidth#=2u#+0.34width#; % Width of all digits if known smallcaps: defchar("0", numwidth#, 1/3[xheight#,cap#], 0, lc_o_pen, 0); else: defchar("0", numwidth#, cap#, 0, lc_o_pen, 0); fi % % 2 % ##### % ### ### % ### ### % ### ### % 3 ### ### 1 % ### ### % ### ### % ### ### % ##### % 4 % rt z1=(w-u+ba+ho,h/2); top z2=(w/2,h+vo); lft z3=(u-ba-ho,h/2); bot z4=(w/2,-vo); draw z1{up}..z2{left}..z3{down}..z4{right}..cycle; endchar; if known smallcaps: defchar("1", numwidth#, 1/3[xheight#,cap#], 0, lcpen, 0); else: defchar("1", numwidth#, cap#, 0, lcpen, 0); fi % % ## 1 % ### % 2 ##### % 4 ### % ### % ### % ### % ### % ### % 3 ##### % diag_bl 3((w-(pen_rt-pen_lft))/2,0,pen_rt-pen_lft,-90); if known smallcaps: z1=(x3,h); cutdraw z3--z1; pickup lcthinpen; top z2=(x3l-lc_thick,h); cutdraw bot z1..z2; else: z1=(x3r,h+vo); x2r=x3l-(pen_rt-pen_lft); z2l=z1+whatever*(1,1); penpos2(lc_thin,-45); x4=x3l; z4=z2r+whatever*(1,1); fill z1--z2l--z2r--z4--z3l--z3r--cycle; fi; endchar; if known smallcaps: defchar("2", numwidth#, 1/3[xheight#,cap#], 0, lccurvepen, 0); else: defchar("2", numwidth#, cap#, 0, lccurvepen, 0); fi % % 2 % ##### % 1 # ## 3 % # % 9 # % # 7 % #5 6# % ###### % 4 ###### 8 % save p; path p; z1l=(0.027xheight+u-ba,0.76h); penpos1(fine,inclination-90); top z2=(w/2,h+vo); penpos2(pen_top-pen_bot,-90); penstroke z1e{dir(inclination)}..{right}z2e; bot lft z4=(u-ba,0); rt z3=(w-0.027xheight-u+ba+ho,0.8h); z9=(w/2,0.40h); p=z2{right}...z3{down}...z9...z4; draw p; x7=w-u+ba+ho; y6=pen_rt-pen_lft; penpos6(serifht,0); z7'=z7+fine*left; z7=z6r+serifwd*dir inclination; y8=0; z8+whatever*dir inclination=z7; z5=((0,y6)..(w,y6)) intersectionpoint (p--(x4,0)); if known sans: fill bot lft z4--z8--z6r--z5--cycle else: fill bot lft z4--z8--z7--z7'{z8-z7}..tension tens..{left}z6l--z5--cycle fi; endchar; if known smallcaps: defchar("3", numwidth#, 1/3[xheight#,cap#], descender#, lccurvepen, 0); else: defchar("3", numwidth#, cap#, 0, lccurvepen, 0); fi % % 2 % #### % 1 # ## 3 % ## % 4 ### % ## % ## % ## 5 % 7 ## # % ### % 6 % z1l=(0.027xheight+u-ba,0.85[-d,h]); penpos1(fine,inclination-90); top z2=(w/2,h+vo); penpos2(pen_top-pen_bot,-90); penstroke z1e..{right}z2e; % z7l=(u-ba,0.15[-d,h]); penpos7(fine,90-inclination); bot z6=(w/2,-d-vo); penpos6(pen_top-pen_bot,90); % penstroke z7e..{right}z6e; bot lft z7=(u-ba-ho,-d+bowljoin/2); rt z3=(w-(pen_rt-pen_lft)/2-u+ba+ho,1/2[y4,y2]); z4=(w/2,0.6[-d,h]); rt z5=(w-u+ba+ho,1/2[y6,y4]); draw z2{right}..z3{down}..{left}z4; % draw z4{right}..{down}z5..{left}z6; draw z4{right}..{down}z5..{left}z6..z7; endchar; if known smallcaps: defchar("4", numwidth#, 1/3[xheight#,cap#], descender#, lcpen, 0); else: defchar("4", numwidth#, cap#, 0, lcpen, 0); fi % % 1 % ## % ## 5 % ## ## % ## ## % 2 ######### 4 % 3 ## % #### % 6 % z1=(w/2,h); penpos1((pen_rt-pen_lft)/sind inclination, 0); if known smallcaps: z2l=(u-ba-ho,0); penpos2(x1r-x1l,0); % Left tip else: z2l=(u-ba-ho,0.25h); penpos2(x1r-x1l,0); % Left tip fi penstroke z1e..z2e; % Left arm z3l=z2l; y3r=y3l+lc_thin; penpos3(whatever,inclination); z4r=(w-u+ba+ho,y3r); y4l=y3l; penpos4(whatever,inclination); penstroke z3e..z4e; % Horizontal bar diag_br 6(w-u,-d,(pen_rt-pen_lft),-90); z5=(x6,0.7[-d,h]); penpos5(pen_rt-pen_lft,0); penstroke z5e..z6e; % Vertical stem endchar; if known smallcaps: defchar("5", numwidth#, 1/3[xheight#,cap#], descender#, lccurvepen, 0); else: defchar("5", numwidth#, cap#, 0, lccurvepen, 0); fi % % 6 7 % ###### % ## # 8 % ###### % 5 4 ## % ## % ## 3 % 1 ## # % ##### % 2 % % z1l=(u-ho,0.15[-d,h]); penpos1(fine,90-inclination); bot z2=(w/2,-d-vo); penpos2(pen_top-pen_bot,90); % penstroke z1e..{right}z2e; bot lft z1=(u-ba,-d+bowljoin/2); rt z3=(w-u+ba+ho,1/2[y2,y4]); z4=(w/2,0.65[-d,h]); lft z5=(u-ba+0.02height,top y4-bowljoin/2); % draw z2{right}..{up}z3..{left}z4..z5; draw z1..z2{right}..{up}z3..{left}z4..z5; top y6=h; z6=z5+whatever*dir inclination; top y7=h; x8=w-0.027xheight-u+ba; top rt z7+(lc_thin+serifwd)*dir(-inclination)=z8; z8'=z8+fine*left; if known sans: fill rt z5--bot z5--bot lft z5--top lft z6-- top rt z7--bot rt z7--bot rt z6--cycle else: fill rt z5--bot z5--bot lft z5--top lft z6-- top rt z7--z8--z8'{top rt z7-z8}..tension tens..{left}bot lft z7-- bot rt z6--cycle fi; endchar; if known smallcaps: defchar("6", numwidth#, cap#, 0, lccurvepen, 0); else: defchar("6", numwidth#, cap#, 0, lccurvepen, 0); fi % % ### 1 % ## % # % ## 5 % ###### % 2 ##6 ## % ## ## 4 % 7 ## ## % ## # % #### % 3 % z5=(w/2,0.58h); z1l=(w-0.03xheight-u+ba,h+vo); penpos1(fine,-90); lft z2=(u-ba-ho,top y5-1/2bowljoin); penpos2(pen_rt-pen_lft,0); bot z3=(w/2,-vo); rt z4=(w-u+ba+ho,1/2[y3,y5]); z7=(x2,top y5-bowljoin); penpos7(pen_rt-pen_lft,0); penstroke z1e{left}..{down}z2e..{down}z7e; draw z7{down}..z3{right}..z4{up}..z5{left}..cycle; endchar; if known smallcaps: defchar("7", numwidth#, 1/3[xheight#,cap#], descender#, lcpen, 0); else: defchar("7", numwidth#, cap#, 0, lcpen, 0); fi % % 2 3 % ######## 4 % 1 # ## % ## % ## % ## % ## % ## 5 % x1=u-ba; % Tip of serif y2r=h; y2l=h-lc_thin; penpos2(whatever,inclination); z1+serifwd*dir inclination=z2l; z1'=z1+fine*right; if unknown sans: fill z1--z1'{z2r-z1}..tension tens..z2l+serifht*right-- z2r+serifht*right--z2r--cycle fi; z3r=(w-u+ba,h); y3l=h-lc_thin; penpos3(whatever,55); penstroke z2e..z3e; % Horizontal bar top rt z4=z3r; lft z5=(u+(pen_rt-pen_lft)/2,-d); draw z5{up}..tension tens..z4; % Stem cutoff (z5, -90); % fill bot lft z4--rt z4--top rt z4--top lft z4--cycle; endchar; if known smallcaps: defchar("8", numwidth#, cap#, 0, lccurvepen, 0); else: defchar("8", numwidth#, cap#, 0, lccurvepen, 0); fi % % 1 % ### % # ## % 2 ## ## 7 % ## # % ### 6 % # ## % ## ## % 5 ## ## 3 % ## # % ### % 4 % top z1=(w/2,h+vo); lft z2=(0.027h+u-ba-ho,0.5[y6,y1]); rt z3=(w-u+ba+ho,0.5[y6,y4]); bot z4=(w/2,-vo); z5=(w-x3,y3); z6=(w/2,0.55h); z7=(w-x2,y2); cutdraw z3{down}..{left}z4..{up}z5..{dir(90-inclination)}z6.. {up}z7..{left}z1..{down}z2; pickup lcthickpen; cutdraw z2{down}..{dir(inclination-90)}z6..{down}z3; endchar; if known smallcaps: defchar("9", numwidth#, 1/3[xheight#,cap#], descender#, lccurvepen, 0); else: defchar("9", numwidth#, cap#, 0, lccurvepen, 0); fi % % 3 % #### % # ## % ## ## % 4 ## ## % ## 6## 2 % ###### % 5 ## % # % ## % 1 ### % % save p; path p[]; if known smallcaps: bot z5=(w/2,-vo); else: z5=(w/2,0.42h); fi z1r=(0.027xheight+u,-d-vo); penpos1(fine,-90); rt z2=(w-u+ba+ho,bot y5+bowljoin); penpos2(pen_rt-pen_lft,0); penstroke z1e{right}..{up}z2e; top z3=(w/2,h+vo); lft z4=(u-ba-ho,1/2[y3,y5]); draw z2{up}..z3{left}..z4{down}..z5{right}..{up}z2; endchar;