From dbdaa8c3ce30ed3514c5b2e0fb227b06152ba7ca Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 5 Apr 2019 21:05:06 +0000 Subject: knitting (5apr19) git-svn-id: svn://tug.org/texlive/trunk@50782 c570f23f-e606-0410-a88d-b1316a301751 --- .../fonts/source/public/knitting/knit_dimens.mf | 16 +- .../source/public/knitting/knit_grid_cables.mf | 117 +++--- .../source/public/knitting/knit_nogrid_cables.mf | 433 ++++++++++++++++++--- .../fonts/source/public/knitting/knit_symbols.mf | 223 +++++++---- .../fonts/source/public/knitting/knitg_sc_in.mf | 5 +- .../fonts/source/public/knitting/knitg_sc_out.mf | 5 +- .../fonts/source/public/knitting/knitgg.mf | 3 +- .../fonts/source/public/knitting/knitgn.mf | 3 +- .../fonts/source/public/knitting/knitmg.mf | 22 ++ .../fonts/source/public/knitting/knitml.mf | 27 ++ .../fonts/source/public/knitting/knitmn.mf | 22 ++ .../fonts/source/public/knitting/knitmp.mf | 23 ++ .../fonts/source/public/knitting/knitmr.mf | 27 ++ .../fonts/source/public/knitting/knitnl.mf | 3 +- .../fonts/source/public/knitting/knitnr.mf | 3 +- .../fonts/source/public/knitting/knitw_sc_in.mf | 25 -- .../fonts/source/public/knitting/knitw_sc_out.mf | 25 -- 17 files changed, 730 insertions(+), 252 deletions(-) create mode 100644 Master/texmf-dist/fonts/source/public/knitting/knitmg.mf create mode 100644 Master/texmf-dist/fonts/source/public/knitting/knitml.mf create mode 100644 Master/texmf-dist/fonts/source/public/knitting/knitmn.mf create mode 100644 Master/texmf-dist/fonts/source/public/knitting/knitmp.mf create mode 100644 Master/texmf-dist/fonts/source/public/knitting/knitmr.mf delete mode 100644 Master/texmf-dist/fonts/source/public/knitting/knitw_sc_in.mf delete mode 100644 Master/texmf-dist/fonts/source/public/knitting/knitw_sc_out.mf (limited to 'Master/texmf-dist/fonts/source/public/knitting') diff --git a/Master/texmf-dist/fonts/source/public/knitting/knit_dimens.mf b/Master/texmf-dist/fonts/source/public/knitting/knit_dimens.mf index e705e163dfb..5066b71a814 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knit_dimens.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knit_dimens.mf @@ -1,4 +1,4 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 widewd# = 16.3pt#; % This is as wide as a cell can be without causing problems with 5-cell-wide symbols @@ -8,6 +8,7 @@ if known wd#: else: wd# = 12 pt#; fi symbolwidth#=0.7pt#; purl_symbolwidth#=0.7pt#; finesymbolwidth# = 0.4pt#; + dotwidth# = 1pt#; gridwidth# = if gridfont: 0.3pt# else: 0pt# fi; overlinewd# = if gridfont: 1.5pt# else: 0.8pt# fi; @@ -37,10 +38,14 @@ cableextend# := 0pt#; % cable connectors, or in wide increases and decreases, you might want % to make this nonzero. -if gridfont: +if known gridcables: else: boolean gridcables; gridcables = gridfont; fi + +nogrid_purlextend# := 0.2pt#; + +if gridcables: purlextend# := 0pt#; else: -purlextend# := 0.2pt#; +purlextend# := nogrid_purlextend#; fi % Purlextend affects how far outside their box the purl background goes. @@ -52,14 +57,15 @@ fi % particular printer, this is one parameter you *have* to fiddle with. define_pixels(wd,ht,dp); -define_blacker_pixels(cableextend,purlextend,gridwidth,symbolwidth, - purl_symbolwidth, finesymbolwidth, overlinewidth); +define_blacker_pixels(cableextend,purlextend,nogrid_purlextend,gridwidth,symbolwidth, + purl_symbolwidth, finesymbolwidth, overlinewidth, dotwidth); define_pixels(eraserwidth,wrapturngap); define_corrected_pixels(o,ho); define_pixels(standardgap,smallgap,mingap,topgap,bottomgap, cablevertgap,cablebargap,cableslant, botcableheight,topcableheight); pickup pencircle scaled symbolwidth; symbol_pen := savepen; +pickup pencircle scaled dotwidth; dot_pen := savepen; pickup pencircle scaled finesymbolwidth; fine_pen := savepen; pickup pencircle scaled purl_symbolwidth; purl_symbol_pen := savepen; pickup pencircle scaled eraserwidth; eraser_pen := savepen; diff --git a/Master/texmf-dist/fonts/source/public/knitting/knit_grid_cables.mf b/Master/texmf-dist/fonts/source/public/knitting/knit_grid_cables.mf index e127626bd5e..f101cd98664 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knit_grid_cables.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knit_grid_cables.mf @@ -1,4 +1,4 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 picture symbolpic[]; @@ -18,22 +18,21 @@ endchar; code := 127; +beginchar("-",wd#,ht#,dp#); "A knit stitch"; + charbox; endchar; +beginchar("=",wd#,ht#,dp#); "A purl stitch"; + purlbox; endchar; beginchar(".",incrwidth(0,0),ht#,dp#); "No stitch"; fill (0.5(w-standardheight),-d+bottomgap) -- - (0.5(w-standardheight),h-topgap) -- - (0.5(w+standardheight),h-topgap) -- - (0.5(w+standardheight),-d+bottomgap) -- cycle; + (0.5(w-standardheight),h-topgap) -- + (0.5(w+standardheight),h-topgap) -- + (0.5(w+standardheight),-d+bottomgap) -- cycle; symbolpic0 := currentpicture; charbox; endchar; beginchar(",",incrwidth(0,0),ht#,dp#); "Purl no stitch"; currentpicture := symbolpic0; purlbox; endchar; - -beginchar("-",wd#,ht#,dp#); "A knit stitch"; - charbox; endchar; -beginchar("=",wd#,ht#,dp#); "A purl stitch"; - purlbox; endchar; - + % Cables cablelinewidth#:=0.4pt#; @@ -43,32 +42,46 @@ pickup pencircle scaled cablelinewidth; cable_pen := savepen; % The one-letter cells beginchar("p",wd#,ht#,dp#); "Purl cable background"; + currentpicture := errorsymbol1; purlbox; endchar; beginchar("P",wd#,ht#,dp#); "Purl cable foreground"; + currentpicture := errorsymbol1; purlbox; endchar; beginchar("k",wd#,ht#,dp#); "Knit cable background"; + currentpicture := errorsymbol1; charbox; endchar; beginchar("K",wd#,ht#,dp#); "Knit cable foreground"; + currentpicture := errorsymbol1; charbox; endchar; beginchar("g",wd#,ht#,dp#); "Purl cable background"; + currentpicture := errorsymbol1; purlbox; endchar; beginchar("G",wd#,ht#,dp#); "Purl cable foreground"; + currentpicture := errorsymbol1; purlbox; endchar; beginchar("c",wd#,ht#,dp#); "Knit cable background"; + currentpicture := errorsymbol1; charbox; endchar; beginchar("C",wd#,ht#,dp#); "Knit cable foreground"; + currentpicture := errorsymbol1; charbox; endchar; beginchar("d",wd#,ht#,dp#); "White knit cable background"; + currentpicture := errorsymbol1; charbox; endchar; beginchar("D",wd#,ht#,dp#); "White knit cable foreground"; + currentpicture := errorsymbol1; charbox; endchar; beginchar("n",wd#,ht#,dp#); "Odd knit cable background"; + currentpicture := errorsymbol1; charbox; endchar; beginchar("N",wd#,ht#,dp#); "Odd knit cable foreground"; + currentpicture := errorsymbol1; charbox; endchar; beginchar("e",wd#,ht#,dp#); "Odd twist"; + currentpicture := errorsymbol1; charbox; endchar; beginchar("o",wd#,ht#,dp#); "Odd twist"; + currentpicture := errorsymbol1; charbox; endchar; % Horizontal cables @@ -96,7 +109,7 @@ specialhoriz := ASCII"/"; beginchar(midhoriz,wd#,ht#,dp#); "Middle of a horizontal cable"; charbox; pickup pensquare scaled cablelinewidth; - x1=x4=0; x2=x3=w; bot y1=bot y2= -d+bottomgap; top y3=top y4=h-topgap; + x1=x4=gridwidth/2; x2=x3=w-gridwidth/2; bot y1=bot y2= -d+bottomgap; top y3=top y4=h-topgap; if (fonttype = gridtype) or (fonttype = bothtype): draw rt z1--lft z2; draw lft z3--rt z4; fi @@ -104,15 +117,17 @@ beginchar(midhoriz,wd#,ht#,dp#); "Middle of a horizontal cable"; fill z1--z2--(w,-d)--(0,-d)--cycle; fill z4--z3--(w,h)--(0,h)--cycle; fi + labels(1,2,3,4); endchar; beginchar(specialhoriz,wd#,ht#,dp#); "Special horizontal cable"; charbox; pickup pensquare scaled cablelinewidth; - x1=x4=0; x2=x3=w; bot y1=bot y2= -d+bottomgap; top y3=top y4=h-topgap; + x1=x4=gridwidth/2; x2=x3=w-gridwidth/2; + bot y1=bot y2= -d+bottomgap; top y3=top y4=h-topgap; x5=x6; x7=x8; x7-x5 = y3-y2; 0.5[x7,x5]=0.5w; - y5=y7=-d; y6=y8=h; + y5=y7=-d+gridwidth/2; y6=y8=h-gridwidth/2; if (fonttype = gridtype) or (fonttype = bothtype): draw top z5--bot z6; draw top z7--bot z8; @@ -128,10 +143,11 @@ beginchar(specialhoriz,wd#,ht#,dp#); "Special horizontal cable"; fill (x3,y8)--z3--(x8,y3)--z8--cycle; fill (x4,y6)--z4--(x6,y4)--z6--cycle; fi + labels(1,2,3,4,5,6,7,8); endchar; -beginchar(righthoriz,wd#,ht#,dp#); "Right end of a horizontal cable"; +beginchar(righthoriz,if fonttype = counttype: 0 else: wd# fi,ht#,dp#); "Right end of a horizontal cable"; fliphoriz(symbolpic0)(currentpicture); endchar; @@ -154,24 +170,28 @@ numeric botcableleft[][]; numeric botcableright[][]; for sts = 2 upto 3: cableright[0][sts][0] := incr code; beginchar(code, (sts)*wd#,ht#,dp#); decimal sts&" cable background stitches"; + addto currentpicture also errorsymbol[sts]; charbox; endchar; cableleft[sts][0][0] := incr code; beginchar(code, (sts)*wd#,ht#,dp#); decimal sts&" cable foreground stitches"; - charbox; endchar; + addto currentpicture also errorsymbol[sts]; + charbox; endchar; revcableright[0][sts] := incr code; beginchar(code, (sts)*wd#,ht#,dp#); decimal sts&" twist background stitches"; - purlbox; endchar; + addto currentpicture also errorsymbol[sts]; + purlbox; endchar; revcableleft[sts][0] := incr code; beginchar(code, (sts)*wd#,ht#,dp#); decimal sts&" twist foreground stitches"; - purlbox; endchar; + addto currentpicture also errorsymbol[sts]; + purlbox; endchar; endfor % Draw the cables -if known slantlines: else: boolean slantlines; slantlines = false; fi +if known slantcutoff: else: slantcutoff = 0; fi for backsts = 1 upto 3: for frontsts = 1 upto 3: @@ -213,32 +233,19 @@ beginchar(cableleft[frontsts][backsts][midsts],totsts * wd#,ht#,dp#); if (fonttype = gridtype) or (fonttype = bothtype): % Define top and bottom points - if slantlines: for k=0 upto totsts: - z.bot[k] = (k*wd,-d); - z.top[k] = (k*wd,h); - penpos.bot[k] (frontstroke, 0); - penpos.top[k] (frontstroke, 0); + z.bot[k] = (k*wd,-d); + z.top[k] = (k*wd,h); + penpos.bot[k] (frontstroke, 0); + penpos.top[k] (frontstroke, 0); + endfor + + for k=0 upto totsts: + labels(bot[k],top[k],bot[k]l,bot[k]r,top[k]l,top[k]r); endfor - else: - z.top[0] = (0,h); - z.top[frontsts] = (frontsts*wd,h); - z.top[totsts] = (totsts*wd,h); - z.bot[0] = (0,-d); - z.bot[backsts] = (backsts*wd,-d); - z.bot[totsts] = (totsts*wd,-d); - if midsts > 0: - z.bot[backsts+midsts] = ((backsts+midsts)*wd,-d); - z.top[frontsts+midsts] = ((frontsts+midsts)*wd,h); - fi - penpos.bot[backsts+midsts] (frontstroke, 0); - penpos.top[0] (frontstroke, 0); - penpos.bot[totsts] (frontstroke, 0); - penpos.top[frontsts] (frontstroke, 0); - fi % Draw the lines on the front cable - if slantlines: + if slantcutoff > (backsts+midsts-1): for k=1 upto frontsts-1: penstroke z.top[k]e -- z.bot[k+backsts+midsts]e; endfor @@ -266,23 +273,12 @@ beginchar(cableleft[frontsts][backsts][midsts],totsts * wd#,ht#,dp#); slip = whatever * (-backsts,1); % Define some more points - if slantlines: for k=0 upto backsts: z.ur[k] = whatever [z.top0,z.bot[backsts+midsts]]; z.ur[k] = whatever [z.bot[k],z.top[frontsts+midsts+k]]; z.ll[k] = whatever [z.bot[totsts],z.top[frontsts]]; z.ll[k] = whatever [z.bot[k],z.top[frontsts+midsts+k]]; endfor - else: - z.ur[0] = whatever [z.top0,z.bot[backsts+midsts]]; - z.ur[0] = whatever [z.bot0,z.top[frontsts+midsts]]; - z.ll[backsts] = whatever [z.bot[totsts],z.top[frontsts]]; - z.ll[backsts] = whatever [z.bot[backsts],z.top[totsts]]; - z.ur[backsts] = whatever [z.top0,z.bot[backsts+midsts]]; - z.ur[backsts] = whatever [z.bot[backsts],z.top[totsts]]; - z.ll[0] = whatever [z.bot[totsts],z.top[frontsts]]; - z.ll[0] = whatever [z.bot[0],z.top[frontsts+midsts]]; - fi % Top back lines fill z.top[totsts]+(-backstroke,0) -- z.top[totsts] -- z.top[totsts]+(0,-ypart(slip)) -- z.ll[backsts]-slip -- z.ll[backsts]+slip --cycle; @@ -291,7 +287,7 @@ beginchar(cableleft[frontsts][backsts][midsts],totsts * wd#,ht#,dp#); fill z.top[frontsts+midsts]+(-backstroke,0) -- z.top[frontsts+midsts]+(backstroke,0) -- z.ll[0]-slip -- z.ll[0]+slip --cycle; fi - if slantlines: + if slantcutoff > (frontsts+midsts-1): for k=1 upto backsts-1: fill z.top[frontsts+midsts+k]+(-backstroke,0) -- z.top[frontsts+midsts+k]+(backstroke,0) -- z.ll[k]-slip -- z.ll[k]+slip --cycle; endfor @@ -306,7 +302,7 @@ beginchar(cableleft[frontsts][backsts][midsts],totsts * wd#,ht#,dp#); fill z.bot[backsts]+(backstroke,0) -- z.bot[backsts]-(backstroke,0) -- z.ur[backsts]+slip -- z.ur[backsts]-slip --cycle; fi - if slantlines: + if slantcutoff > (frontsts+midsts-1): for k=1 upto backsts-1: fill z.bot[k]+(backstroke,0) -- z.bot[k]-(backstroke,0) -- z.ur[k]+slip -- z.ur[k]-slip --cycle; endfor @@ -355,7 +351,20 @@ beginchar(twistleft[frontsts][backsts],totsts * wd#,ht#,dp#); % Twist/twist front "Twist " & decimal(frontsts) & " over " &decimal(backsts); charbox; - if fonttype <> purltype: currentpicture := symbolpic1; + if fonttype <> purltype: + currentpicture := symbolpic1; + % Draw some missing lines + for k=1 upto backsts-1: + z.bot[k] = (k*wd,-d); + x.slant.bot[k] = k*wd; + z.slant.bot[k] = whatever[(0,h),(backsts*wd,-d)]; + draw z.bot[k]--z.slant.bot[k]; + + z.top[k] = ((frontsts+k)*wd,h); + x.slant.top[k] = (frontsts+k)*wd; + z.slant.top[k] = whatever[(frontsts*wd,h),(w,-d)]; %whatever[(w,-d),(w-backsts*wd,h)]; + draw z.top[k]--z.slant.top[k]; + endfor else: fill (0,h)--(wd*backsts,-d)--(0,-d)--cycle; % Bottom triangle fill (w,-d)--(wd*frontsts,h)--(w,h)--cycle; % Top triangle diff --git a/Master/texmf-dist/fonts/source/public/knitting/knit_nogrid_cables.mf b/Master/texmf-dist/fonts/source/public/knitting/knit_nogrid_cables.mf index 126d1f28176..a99f64d9c66 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knit_nogrid_cables.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knit_nogrid_cables.mf @@ -1,26 +1,27 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 -beginchar(",",incrwidth(0,0),ht#,dp#); "No stitch"; - purlbox; - endchar; -beginchar(".",incrwidth(0,0),ht#,dp#); "No stitch"; - endchar; - - path purlbar; +code := 127; + +if known debugcables: else: boolean debugcables; debugcables = true; fi beginchar("-",wd#,ht#,dp#); "A knit stitch"; pickup symbol_pen; draw bot (w/2,h-topgap+o) -- top (w/2, -d+bottomgap-o); charbox; endchar; +path purlbar; beginchar("=",wd#,ht#,dp#); "A purl stitch"; pickup symbol_pen; lft x1-rt x2 = 0.7standardheight; x1+x2=w; y1=y2=0.5[h,-d]; purlbar = z1--z2; draw purlbar; purlbox; endchar; - -code := 127; - +beginchar(",",incrwidth(0,0),ht#,dp#); "No stitch"; + purlbox; + endchar; +beginchar(".",incrwidth(0,0),ht#,dp#); "No stitch"; + charbox; + endchar; + %Cables kright := incr code; @@ -34,12 +35,116 @@ dright := incr code; oright := incr code; Dright := incr code; +%if debugcables: +kleft := incr code; +Kleft := incr code; +pleft := incr code; +Pleft := incr code; +nleft := incr code; +eleft := incr code; +Nleft := incr code; +dleft := incr code; +oleft := incr code; +Dleft := incr code; +%fi + +% Cable background/foreground blocks (empty cables) +cablebgblock := 255; +cablefgblock := 254; +cablebgblockright := incr code; +cablefgblockright := incr code; +cablebgblockleft := incr code; +cablefgblockleft := incr code; + +% Grid outlines and empty cables + left_cable_grid := incr code; + mid_cable_grid := incr code; +right_cable_grid_bg := incr code; +right_cable_grid_fg := incr code; + left_cable_grid_rt := incr code; + mid_cable_grid_rt := incr code; +right_cable_grid_rt := incr code; + +% Empty boxes +if gridfont: + noknitleft := incr code; + noknitmid := incr code; + noknitright:= incr code; + nopurlleft := incr code; + nopurlmid := incr code; + nopurlright:= incr code; + + beginchar(noknitleft, if fonttype = counttype: 0 else: wd# fi, ht#, dp#); "Left no stitch"; + leftgrid_charbox; + endchar; + beginchar(noknitmid, if fonttype = counttype: 0 else: wd# fi, ht#, dp#); "Middle no stitch"; + topbotgrid_charbox; + endchar; + beginchar(noknitright, if fonttype = counttype: 0 else: wd# fi, ht#, dp#); "Right no stitch"; + rightgrid_charbox; + endchar; + + beginchar(nopurlleft, if fonttype = counttype: 0 else: wd# fi, ht#, dp#); "Left no stitch"; + leftgrid_charbox; + if fonttype = purltype: + fill + ( 0,-d)-- + (w+nogrid_purlextend,-d)-- + (w+nogrid_purlextend, h)-- + ( 0, h)--cycle; + fi + endchar; + beginchar(nopurlmid, if fonttype = counttype: 0 else: wd# fi, ht#, dp#); "Middle no stitch"; + topbotgrid_charbox; + if fonttype = purltype: + fill + ( -nogrid_purlextend,-d)-- + (w+nogrid_purlextend,-d)-- + (w+nogrid_purlextend, h)-- + ( -nogrid_purlextend, h)--cycle; + fi + endchar; + beginchar(nopurlright, if fonttype = counttype: 0 else: wd# fi, ht#, dp#); "Right no stitch"; + rightgrid_charbox; + if fonttype = purltype: + fill + ( -nogrid_purlextend,-d)-- + (w,-d)-- + (w, h)-- + ( -nogrid_purlextend, h)--cycle; + fi + endchar; + + ligtable ".": "." =:| noknitleft; + ligtable noknitleft: "." |=: noknitright; + ligtable noknitright: "." =:| noknitmid; + ligtable noknitmid: "." |=: noknitright; + + ligtable ",": "," =:| nopurlleft; + ligtable nopurlleft: "," |=: nopurlright; + ligtable nopurlright: "," =:| nopurlmid; + ligtable nopurlmid: "," |=: nopurlright; +fi + +% Cable background blocks + +beginchar(cablebgblock, wd#, ht#, dp#); + addto currentpicture also errorsymbol1; + endchar; +beginchar(cablefgblock, wd#, ht#, dp#); + addto currentpicture also errorsymbol1; + endchar; +beginchar(cablebgblockright, wd#, ht#, dp#); endchar; +beginchar(cablefgblockright, wd#, ht#, dp#); endchar; +beginchar(cablebgblockleft, wd#, ht#, dp#); endchar; +beginchar(cablefgblockleft, wd#, ht#, dp#); endchar; + midhoriz := 20; righthoriz := 21; specialhoriz := ASCII"/"; -cabletopleft := 5; -cablebotleft := 6; +cabletopleft := 15; +cablebotleft := 16; cabletopright:= 7; cablebotright:= 8; @@ -65,21 +170,22 @@ beginchar("+",wd#,ht#,dp#); "Horizontal cable"; symbolpath1 := z.ll--z.lr; draw symbolpath0; draw symbolpath1; symbolpic0 := currentpicture; - charbox; endchar; + leftgrid_charbox; endchar; -%beginchar(midhoriz,wd#,ht#,dp#); "Middle of a horizontal cable"; -% currentpicture := symbolpic0; -% charbox; endchar; -%beginchar(righthoriz,wd#,ht#,dp#); "Right end of a horizontal cable"; -% currentpicture := symbolpic0; -% charbox; endchar; -% -%ligtable "+": specialhoriz: -% "+" |=: righthoriz; -%ligtable righthoriz: -% "+" |=: righthoriz, -% specialhoriz =:| midhoriz, -% righthoriz =:| midhoriz; +beginchar(midhoriz,wd#,ht#,dp#); "Middle of a horizontal cable"; + currentpicture := symbolpic0; + topbotgrid_charbox; endchar; +beginchar(righthoriz,if fonttype = counttype: 0 else: wd# fi,ht#,dp#); "Right end of a horizontal cable"; + currentpicture := symbolpic0; + rightgrid_charbox; endchar; + +ligtable "+": specialhoriz: + "+" |=: righthoriz; +ligtable righthoriz: + "+" |=: righthoriz, + specialhoriz =:| midhoriz, + righthoriz =:| midhoriz; + beginchar(specialhoriz,wd#,ht#,dp#); "Special horizontal cable"; pickup symbol_pen; @@ -94,15 +200,24 @@ beginchar(specialhoriz,wd#,ht#,dp#); "Special horizontal cable"; draw lft (w/2-specialspread,y.lr)--z.ll; draw (w/2+specialspread,HCttop)--(w/2+specialspread,HCbbot); draw (w/2-specialspread,HCttop)--(w/2-specialspread,HCbbot); - charbox; endchar; + topbotgrid_charbox; endchar; beginchar("k",wd#,ht#,dp#); "Knit cable background"; pickup symbol_pen; + %if gridfont: + %drawdot (w/2, 0.5[botcableheight+cablevertgap,h-topgap]); + %else: draw top (w/2, botcableheight+cablevertgap)--bot(w/2,h-topgap); + %fi charbox; symbolpic0 := currentpicture; + addto currentpicture also errorsymbol1; endchar; beginchar("c",wd#,ht#,dp#); "Knit cable background"; + currentpicture := symbolpic0; + addto currentpicture also errorsymbol1; + endchar; +beginchar(kleft,wd#,ht#,dp#); "Knit cable background"; currentpicture := symbolpic0; endchar; beginchar(kright,wd#,ht#,dp#); "Knit cable background"; @@ -111,17 +226,24 @@ beginchar(kright,wd#,ht#,dp#); "Knit cable background"; beginchar("p",wd#,ht#,dp#); "Purl cable background"; pickup symbol_pen; + %if gridfont: + %drawdot (w/2, 0.5[botcableheight+cablevertgap,h-topgap]); + %else: draw purlbar; - purlbox; + %fi + charbox; purlfill; symbolpic0 := currentpicture; + addto currentpicture also errorsymbol1; endchar; beginchar("g",wd#,ht#,dp#); "Purl cable background"; currentpicture := symbolpic0; - purlbox; + addto currentpicture also errorsymbol1; endchar; beginchar(pright,wd#,ht#,dp#); "Purl cable background"; currentpicture := symbolpic0; - purlbox; + endchar; +beginchar(pleft,wd#,ht#,dp#); "Purl cable background"; + currentpicture := symbolpic0; endchar; beginchar("n",incrwidth(0,1),ht#,dp#); "Back make one"; @@ -129,81 +251,123 @@ beginchar("n",incrwidth(0,1),ht#,dp#); "Back make one"; drawM(h-topgap, botcableheight+cablevertgap, 0.5wd,symbolwidth); charbox; symbolpic0:=currentpicture; + addto currentpicture also errorsymbol1; endchar; beginchar(nright,incrwidth(0,1),ht#,dp#); "Back make one"; currentpicture := symbolpic0; endchar; +beginchar(nleft,incrwidth(0,1),ht#,dp#); "Back make one"; + currentpicture := symbolpic0; endchar; beginchar("e",incrwidth(0,1),ht#,dp#); "Back purlwise make one"; pickup purl_symbol_pen; drawM(h-topgap, botcableheight+cablevertgap, 0.5wd,purl_symbolwidth); - symbolpic0:=currentpicture; purlbox; + charbox; purlfill; + symbolpic0:=currentpicture; + addto currentpicture also errorsymbol1; endchar; beginchar(eright,incrwidth(0,1),ht#,dp#); "Back purlwise make one"; currentpicture := symbolpic0; - purlbox; +endchar; +beginchar(eleft,incrwidth(0,1),ht#,dp#); "Back purlwise make one"; + currentpicture := symbolpic0; endchar; beginchar("N",incrwidth(0,1),ht#,dp#); "Front make one"; pickup symbol_pen; drawM(topcableheight-cablevertgap, -d+bottomgap, 0.5wd,symbolwidth); + charbox; symbolpic0 := currentpicture; -charbox; endchar; + addto currentpicture also errorsymbol1; +endchar; beginchar(Nright,incrwidth(0,1),ht#,dp#); "Front make one"; currentpicture := symbolpic0; -charbox; endchar; +endchar; +beginchar(Nleft,incrwidth(0,1),ht#,dp#); "Front make one"; + currentpicture := symbolpic0; +endchar; beginchar("d",decrwidth(2,1),ht#,dp#); "Back decrease"; pickup symbol_pen; drawSSK(h-topgap, botcableheight+cablevertgap); - charbox; symbolpic0:=currentpicture; + charbox; + symbolpic0:=currentpicture; + addto currentpicture also errorsymbol1; endchar; beginchar(dright,decrwidth(2,1),ht#,dp#); "Back decrease"; fliphoriz(symbolpic0)(currentpicture); endchar; +beginchar(dleft,decrwidth(2,1),ht#,dp#); "Back decrease"; + currentpicture := symbolpic0; endchar; beginchar("o",decrwidth(2,1),ht#,dp#); "Back purl decrease"; pickup purl_symbol_pen; drawSSK(h-topgap, botcableheight+cablevertgap); - symbolpic0:=currentpicture; purlbox; + charbox; purlfill; + symbolpic0:=currentpicture; + addto currentpicture also errorsymbol1; endchar; beginchar(oright,decrwidth(2,1),ht#,dp#); "Back purl decrease"; fliphoriz(symbolpic0)(currentpicture); - purlbox; + endchar; +beginchar(oleft,decrwidth(2,1),ht#,dp#); "Back purl decrease"; + currentpicture := symbolpic0;; endchar; beginchar("D",decrwidth(2,1),ht#,dp#); "Front decrease"; pickup symbol_pen; drawSSK(topcableheight-cablevertgap,-d+bottomgap); - charbox; symbolpic0:=currentpicture; + charbox; + symbolpic0:=currentpicture; + addto currentpicture also errorsymbol1; endchar; beginchar(Dright,decrwidth(2,1),ht#,dp#); "Front decrease"; fliphoriz(symbolpic0)(currentpicture); endchar; +beginchar(Dleft,decrwidth(2,1),ht#,dp#); "Front decrease"; + currentpicture := symbolpic0; endchar; beginchar("K",wd#,ht#,dp#); "Knit cable foreground"; pickup symbol_pen; + %if gridfont: + %drawdot (w/2, 0.5[-d+bottomgap,topcableheight-cablevertgap]); + %else: draw top (w/2, -d+bottomgap)--bot(w/2,topcableheight-cablevertgap); + %fi charbox; symbolpic0 := currentpicture; + addto currentpicture also errorsymbol1; endchar; beginchar("C",wd#,ht#,dp#); "Knit cable foreground"; currentpicture := symbolpic0; + addto currentpicture also errorsymbol1; endchar; beginchar(Kright,wd#,ht#,dp#); "Knit cable foreground"; currentpicture := symbolpic0; endchar; +beginchar(Kleft,wd#,ht#,dp#); "Knit cable foreground"; + currentpicture := symbolpic0; + endchar; beginchar("P",wd#,ht#,dp#); "Purl cable foreground"; + %if gridfont: + %pickup dot_pen; + %drawdot (w/2, 0.5[-d+bottomgap,topcableheight-cablevertgap]); + %else: pickup symbol_pen; draw purlbar; - purlbox; + %fi + charbox; purlfill; symbolpic0 := currentpicture; + addto currentpicture also errorsymbol1; endchar; beginchar("G",wd#,ht#,dp#); "Purl cable foreground"; currentpicture := symbolpic0; + addto currentpicture also errorsymbol1; endchar; beginchar(Pright,wd#,ht#,dp#); "Purl cable foreground"; currentpicture := symbolpic0; - purlbox; + endchar; +beginchar(Pleft,wd#,ht#,dp#); "Purl cable foreground"; + currentpicture := symbolpic0; endchar; beginchar("_",0,ht#,dp#); "Cable bottom connector"; @@ -281,10 +445,24 @@ beginchar(cableleftbackslash,0,ht#,dp#); "Cable slash connector"; beginchar(cablerightslash,0,ht#,dp#); "Cable slash connector"; currentpicture := symbolpic0 reflectedabout ((0,0),(0,h)); endchar; + +if gridfont: +beginchar(left_cable_grid,wd#,ht#,dp#); "Left-end cable outlines"; + leftgrid_charbox; endchar; +beginchar(mid_cable_grid,wd#,ht#,dp#); "Cable outlines"; + topbotgrid_charbox; endchar; +beginchar(mid_cable_grid_rt,wd#,ht#,dp#); "Cable outlines"; + topbotgrid_charbox; endchar; +beginchar(right_cable_grid_bg,wd#,ht#,dp#); "Right-end cable outlines"; + rightgrid_charbox; endchar; +beginchar(right_cable_grid_fg,wd#,ht#,dp#); "Right-end cable outlines"; + rightgrid_charbox; endchar; +beginchar(right_cable_grid_rt,wd#,ht#,dp#); "Right-end cable outlines"; + rightgrid_charbox; endchar; +fi -if fonttype = foretype: - -ligtable +if fonttype = gridtype: +ligtable "k": "p": "c": @@ -293,6 +471,119 @@ ligtable "e": "n": "d": +cablebgblock: + "k" |=: right_cable_grid_bg, + "c" |=: right_cable_grid_bg, + "n" |=: right_cable_grid_bg, + "d" |=: right_cable_grid_bg, + "p" |=: right_cable_grid_bg, + "g" |=: right_cable_grid_bg, + "e" |=: right_cable_grid_bg, + "o" |=: right_cable_grid_bg, + cablebgblock |=: right_cable_grid_bg, + "K" |=: right_cable_grid_rt, + "P" |=: right_cable_grid_rt, + "C" |=: right_cable_grid_rt, + "G" |=: right_cable_grid_rt, + "N" |=: right_cable_grid_rt, + "D" |=: right_cable_grid_rt, + cablefgblock |=: right_cable_grid_rt, + right_cable_grid_rt =:| left_cable_grid, + right_cable_grid_bg =:| left_cable_grid; + +ligtable +"K": +"P": +"C": +"G": +"N": +"D": +cablefgblock: + "k" |=: right_cable_grid_rt, + "c" |=: right_cable_grid_rt, + "n" |=: right_cable_grid_rt, + "d" |=: right_cable_grid_rt, + "p" |=: right_cable_grid_rt, + "g" |=: right_cable_grid_rt, + "e" |=: right_cable_grid_rt, + "o" |=: right_cable_grid_rt, + cablebgblock |=: right_cable_grid_rt, + "K" |=: right_cable_grid_fg, + "P" |=: right_cable_grid_fg, + "C" |=: right_cable_grid_fg, + "G" |=: right_cable_grid_fg, + "N" |=: right_cable_grid_fg, + "D" |=: right_cable_grid_fg, + cablefgblock |=: right_cable_grid_fg, + right_cable_grid_rt =:| left_cable_grid, + right_cable_grid_fg =:| left_cable_grid; + +ligtable +right_cable_grid_fg: + "k" |=: right_cable_grid_rt, + "n" |=: right_cable_grid_rt, + "d" |=: right_cable_grid_rt, + "p" |=: right_cable_grid_rt, + "e" |=: right_cable_grid_rt, + "o" |=: right_cable_grid_rt, + cablebgblock |=: right_cable_grid_rt, + "K" |=: right_cable_grid_fg, + "P" |=: right_cable_grid_fg, + "C" |=: right_cable_grid_fg, + "G" |=: right_cable_grid_fg, + "N" |=: right_cable_grid_fg, + "D" |=: right_cable_grid_fg, + cablefgblock |=: right_cable_grid_fg, + right_cable_grid_rt =:| mid_cable_grid, + right_cable_grid_fg =:| mid_cable_grid; +ligtable +right_cable_grid_bg: + "k" |=: right_cable_grid_bg, + "c" |=: right_cable_grid_bg, + "n" |=: right_cable_grid_bg, + "d" |=: right_cable_grid_bg, + "p" |=: right_cable_grid_bg, + "g" |=: right_cable_grid_bg, + "e" |=: right_cable_grid_bg, + "o" |=: right_cable_grid_bg, + cablebgblock |=: right_cable_grid_bg, + "K" |=: right_cable_grid_rt, + "P" |=: right_cable_grid_rt, + "N" |=: right_cable_grid_rt, + "D" |=: right_cable_grid_rt, + cablefgblock |=: right_cable_grid_rt, + right_cable_grid_rt =:| mid_cable_grid, + right_cable_grid_bg =:| mid_cable_grid; +ligtable +right_cable_grid_rt: + "k" |=: right_cable_grid_rt, + "n" |=: right_cable_grid_rt, + "d" |=: right_cable_grid_rt, + "p" |=: right_cable_grid_rt, + "e" |=: right_cable_grid_rt, + "o" |=: right_cable_grid_rt, + cablebgblock |=: right_cable_grid_rt, + "K" |=: right_cable_grid_rt, + "P" |=: right_cable_grid_rt, + "N" |=: right_cable_grid_rt, + "D" |=: right_cable_grid_rt, + cablefgblock |=: right_cable_grid_rt, + right_cable_grid_rt =:| mid_cable_grid; +fi + +if fonttype = foretype: + +for leftglyph = "k", "p", "o", "e", "n", "d", "c", "g", "cablebgblock": + if leftglyph = "cablebgblock": + leftglyphlig := cablebgblockleft; + elseif leftglyph = "c": + leftglyphlig := kleft; + elseif leftglyph = "g": + leftglyphlig := pleft; + else: + leftglyphlig := scantokens (leftglyph & "left"); + fi +ligtable if leftglyph = "cablebgblock": cablebgblock else: leftglyph fi: "k" |=:| cablebotleft, "c" |=:| cablebotleft, "n" |=:| cablebotleft, @@ -301,38 +592,53 @@ ligtable "g" |=:| cablebotleft, "e" |=:| cablebotleft, "o" |=:| cablebotleft, + cablebgblock |=:| cablebotleft, "K" |=:| rightslash, "P" |=:| rightslash, "N" |=:| rightslash, "D" |=:| rightslash, - rightslash |=:| cableleftslash; - -ligtable -"K": -"P": -"C": -"G": -"N": -"D": + cablefgblock |=:| rightslash, + rightslash |=:| cableleftslash, + cablebotleft =:| leftglyphlig, + cableleftslash =:| leftglyphlig; +endfor + +for leftglyph = "K", "P", "C", "G", "N", "D", "cablefgblock": + if leftglyph = "cablefgblock": + leftglyphlig := cablefgblockleft; + elseif leftglyph = "C": + leftglyphlig := Kleft; + elseif leftglyph = "G": + leftglyphlig := Pleft; + else: + leftglyphlig := scantokens (leftglyph & "left"); + fi +ligtable if leftglyph = "cablefgblock": cablefgblock else: leftglyph fi: "K" |=:| cabletopleft, "P" |=:| cabletopleft, "G" |=:| cabletopleft, "C" |=:| cabletopleft, "N" |=:| cabletopleft, "D" |=:| cabletopleft, + cablefgblock |=:| cabletopleft, "k" |=:| leftslash, "p" |=:| leftslash, "o" |=:| leftslash, "e" |=:| leftslash, "n" |=:| leftslash, "d" |=:| leftslash, - leftslash |=:| cableleftbackslash; - + cablebgblock |=:| leftslash, + leftslash |=:| cableleftbackslash, + cabletopleft =:| leftglyphlig, + cableleftbackslash =:| leftglyphlig; +endfor + ligtable Kright: Pright: Nright: Dright: +cablefgblockright: "K" |=: Kright, Kright |=:| cabletopright, "P" |=: Pright, @@ -340,7 +646,9 @@ Dright: "N" |=: Nright, Nright |=:| cabletopright, "D" |=: Dright, - Dright |=:| cabletopright; + Dright |=:| cabletopright, + cablefgblock |=: cablefgblockright, + cablefgblockright |=:| cabletopright; ligtable kright: @@ -349,6 +657,7 @@ oright: eright: nright: dright: +cablebgblockright: "k" |=: kright, kright |=:| cablebotright, "p" |=: pright, @@ -360,7 +669,9 @@ dright: "n" |=: nright, nright |=:| cablebotright, "d" |=: dright, - dright |=:| cablebotright; + dright |=:| cablebotright, + cablebgblock |=: cablebgblockright, + cablebgblockright |=:| cablebotright; ligtable rightslash: "K" |=: Kright, @@ -370,7 +681,9 @@ ligtable rightslash: "N" |=: Nright, Nright |=:| cablerightslash, "D" |=: Dright, - Dright |=:| cablerightslash; + Dright |=:| cablerightslash, + cablefgblock |=: cablefgblockright, + cablefgblockright |=:| cablerightslash; ligtable leftslash: "k" |=: kright, "p" |=: pright, @@ -378,11 +691,13 @@ ligtable leftslash: "e" |=: eright, "n" |=: nright, "d" |=: dright, + cablebgblock |=: cablebgblockright, kright |=:| cablerightbackslash, nright |=:| cablerightbackslash, dright |=:| cablerightbackslash, pright |=:| cablerightbackslash, eright |=:| cablerightbackslash, - oright |=:| cablerightbackslash; + oright |=:| cablerightbackslash, + cablebgblockright |=:| cablerightbackslash; fi diff --git a/Master/texmf-dist/fonts/source/public/knitting/knit_symbols.mf b/Master/texmf-dist/fonts/source/public/knitting/knit_symbols.mf index e39d923d6bd..e0fb61c80af 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knit_symbols.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knit_symbols.mf @@ -1,4 +1,4 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 % Don't flash pictures of the characters as you draw them. % This is dizzying, and UNIX can't do it anyway. @@ -29,41 +29,80 @@ enddef; purltype = 0; gridtype = 1; foretype = 2; -bothtype = 3; +bothtype = 3; % Both the grid and the symbols counttype = 4; if fonttype = counttype: - extra_endchar := extra_endchar & "pickup pencircle scaled 0.2pt; if w>0: draw (0,-d)--(0,h); draw (w,-d)--(w,h); fi"; + % extra_endchar := extra_endchar & " pickup pencircle scaled 0.2pt; if w>0: draw (0,-d)--(0,h); draw (w,-d)--(w,h); fi "; fi +def nogrid_charbox = + if (fonttype = purltype) or (fonttype = gridtype): + currentpicture := nullpicture; + fi + enddef; + +def leftgrid_charbox = + if (fonttype = purltype): currentpicture := nullpicture; fi + if (fonttype = gridtype): currentpicture := nullpicture; fi + if (fonttype = gridtype) or (fonttype = bothtype): + pickup pensquare scaled gridwidth; + draw lft (w,h)--(0,h); + draw (0,h)--(0,-d); + draw (0,-d)--lft (w,-d); + fi +enddef; + +def rightgrid_charbox = + if (fonttype = purltype): currentpicture := nullpicture; fi + if (fonttype = gridtype): currentpicture := nullpicture; fi + if (fonttype = gridtype) or (fonttype = bothtype): + pickup pensquare scaled gridwidth; + draw (w,h)--rt (0,h); + draw (w,h)--(w,-d); + draw rt (0,-d)--(w,-d); + fi +enddef; + +def topbotgrid_charbox = + if (fonttype = purltype): currentpicture := nullpicture; fi + if (fonttype = gridtype): currentpicture := nullpicture; fi + if (fonttype = gridtype) or (fonttype = bothtype): + pickup pensquare scaled gridwidth; + draw (w,h)--(0,h); + draw (0,-d)--(w,-d); + fi +enddef; + if gridfont: def charbox = - if fonttype = purltype: - currentpicture := nullpicture; - else: - if fonttype = gridtype: currentpicture := nullpicture; fi - if (fonttype = gridtype) or (fonttype = bothtype): - pickup pencircle scaled gridwidth; - fill (-gridwidth/2,-d-gridwidth/2)--(w+gridwidth/2,-d-gridwidth/2)-- - (w+gridwidth/2,h+gridwidth/2)--(-gridwidth/2,h+gridwidth/2)--cycle; - if (w>0): - unfill (gridwidth/2,-d+gridwidth/2)--(w-gridwidth/2,-d+gridwidth/2)-- - (w-gridwidth/2,h-gridwidth/2)--(gridwidth/2,h-gridwidth/2)--cycle; - fi - %draw (0,-d)--(w,-d)--(w,h)--(0,h)--cycle; + if fonttype = purltype: + currentpicture := nullpicture; + fi + if fonttype = gridtype: currentpicture := nullpicture; fi + if (fonttype = gridtype) or (fonttype = bothtype): + pickup pencircle scaled gridwidth; + fill (-gridwidth/2,-d-gridwidth/2)--(w+gridwidth/2,-d-gridwidth/2)-- + (w+gridwidth/2,h+gridwidth/2)--(-gridwidth/2,h+gridwidth/2)--cycle; + if (w>0): + unfill (gridwidth/2,-d+gridwidth/2)--(w-gridwidth/2,-d+gridwidth/2)-- + (w-gridwidth/2,h-gridwidth/2)--(gridwidth/2,h-gridwidth/2)--cycle; + fi fi - fi enddef; else: -def charbox = - if fonttype = purltype: - currentpicture := nullpicture; - fi - enddef; +def charbox = nogrid_charbox enddef; fi def purlbox = charbox; purlfill; enddef; +% We don't need any symbols in the counting fonts because we will never +% actually show them and clearing them saves a bit of disk space. +if fonttype = counttype: + def charbox = currentpicture := nullpicture; enddef; + def purlbox = currentpicture := nullpicture; enddef; +fi + picture symbolpic[]; path symbolpath[]; @@ -86,7 +125,30 @@ def definearrow(text thepath, arrowlength, endpath) = --arrowpoint + ((1,0) rotated (arrowdir-150) scaled arrowlength) ; enddef; - + +% Error symbols (glyphs that should not happen) + +if known debugcables: else: boolean debugcables; debugcables = true; fi + +picture errorsymbol[]; +for k=1,2,3: + errorsymbol[k] = nullpicture; +endfor +if debugcables: + errorslashes = 4; + if (fonttype=foretype) or (fonttype=bothtype): + for j=1,2,3: + for k=(1/errorslashes) step (1/errorslashes) until 0.99: + addto errorsymbol[j] doublepath ((0,k[-dp,ht])--(k[wd,0],.001pt+ht)) withpen (pencircle scaled symbolwidth); + addto errorsymbol[j] doublepath ((j*wd,k[-dp,ht])--(k[j*wd,(j-1)*wd],.001pt-dp)) withpen (pencircle scaled symbolwidth); + endfor + for k=0 step (1/errorslashes) until (j-1): + addto errorsymbol[j] doublepath ((k*wd,-dp)--((k+1)*wd,ht)) withpen (pencircle scaled symbolwidth); + endfor + endfor + fi +fi + % Arrow symbols beginchar("s",wd#,ht#,dp#); "Slip one left"; @@ -164,7 +226,7 @@ beginchar("O",incrwidth(0,1),ht#,dp#); "Yarn over"; penpos3(symbolwidth,270); penpos4(symbolwidth,180); penstroke z1e..z2e..z3e..z4e..cycle; - charbox; endchar; + purlbox; endchar; beginchar("@",wd#,ht#,dp#); "Bead"; pickup symbol_pen; @@ -177,7 +239,6 @@ beginchar("@",wd#,ht#,dp#); "Bead"; charbox; endchar; beginchar(ditto,incrwidth(0,0),ht#,dp#); "Wrap and turn"; - if (fonttype = foretype) or (fonttype = bothtype) or (fonttype = counttype): pickup symbol_pen; z0 = 0.4[z1,z3] = 0.5[z2,z4]; x3=x1=w/2; y2=y4; y3-y1=x4-x2; @@ -201,12 +262,12 @@ beginchar(ditto,incrwidth(0,0),ht#,dp#); "Wrap and turn"; definearrow(symbolpath0)((x4-x2)/2)(symbolpath1); draw symbolpath0; draw symbolpath1; - fi symbolpic0 := currentpicture; symbolpicwd0 := w; -endchar; + nogrid_charbox; endchar; beginchar(19,incrwidth(0,0),ht#,dp#); "Reverse wrap and turn"; - fliphoriz(symbolpic0)(currentpicture); currentpicture := currentpicture shifted (-(w-symbolpicwd0)/2,0); - endchar; + fliphoriz(symbolpic0)(currentpicture); + currentpicture := currentpicture shifted (-(w-symbolpicwd0)/2,0); + nogrid_charbox; endchar; ligtable ditto: @@ -324,15 +385,12 @@ beginchar(4,wd#,ht#,dp#); "Purl make N from 1"; purlbox; endchar; beginchar("U",incrwidth(0,1),ht#,dp#); "Cast on"; - if fonttype <> purltype: pickup symbol_pen; bot y1 = bot y3 = -d+bottomgap; x1 = 0; x3 = w; x2 = w/2; top y2 = h-topgap; draw z1{right}..z2{left}..z3{right}; - fi - endchar; + nogrid_charbox; endchar; beginchar("f",decrwidth(1,0),ht#,dp#); "Bind off knitwise"; - if fonttype <> purltype: pickup symbol_pen; x3-x1=wd; 0.5[x1,x3]=w/2; x2 = 0.5[x1,x3]; y1 = y3 = (h-d)/2; top y2 = h-topgap; @@ -340,14 +398,13 @@ beginchar("f",decrwidth(1,0),ht#,dp#); "Bind off knitwise"; symbolpath0 := z1..z2{right}..z3; draw symbolpath0; %draw z4--bot z1; - fi - endchar; + nogrid_charbox; endchar; beginchar("F",decrwidth(1,0),ht#,dp#); "Bind off purlwise"; if fonttype <> purltype: pickup purl_symbol_pen; draw symbolpath0; fi - purlfill; endchar; + nogrid_charbox; purlfill; endchar; beginchar("Z",incrwidth(1,3),ht#,dp#); "Knit one doubly elongated"; pickup symbol_pen; 0.5[z1,z7] = top (w/2, -d+min_bottomgap); @@ -427,43 +484,26 @@ beginchar("9",incrwidth(1,2),ht#,dp#); "CYCA knit one elongated"; beginchar(25,wd#/2,ht#,dp#); "Left end of a wide increase"; - if fonttype <> purltype: pickup pensquare xscaled wideinctip yscaled wideincline; z1 = (w+cableextend,(h-topgap-d+bottomgap)/2); x2 = w/3; top y2 = h-min_topgap+o; fill bot lft z2{down}..bot z1{right}--top z1{left}..top rt z2{up}--top lft z2---cycle; - if gridfont: - if fonttype = gridtype: currentpicture := nullpicture; fi - if (fonttype = gridtype) or (fonttype = bothtype): - pickup pensquare scaled gridwidth; - draw lft (w,h)--(0,h); - draw (0,h)--(0,-d); - draw (0,-d)--lft (w,-d); - fi fi fi symbolpic0 := currentpicture; symbolpicwd0 := w; - endchar; + leftgrid_charbox; endchar; beginchar(22,wd#/2,ht#,dp#); "Extender for a wide increase/decrease"; - if fonttype <> purltype: z1 = (w+cableextend,(h-topgap-d+bottomgap)/2); x2 = 0-cableextend; y2 = y1; pickup pensquare scaled wideincline; draw rt z2 -- lft z1; - if gridfont: - if fonttype = gridtype: currentpicture := nullpicture; fi - if (fonttype = gridtype) or (fonttype = bothtype): - pickup pensquare scaled gridwidth; - draw lft (w,h) -- rt (0,h); draw rt (0,-d) -- lft (w,-d); - fi fi fi - endchar; + topbotgrid_charbox; endchar; beginchar(26,wd#/2,ht#,dp#); "Right end of a wide increase"; - fliphoriz(symbolpic0)(currentpicture); currentpicture := currentpicture shifted (-(w-symbolpicwd0)/2,0); endchar; + fliphoriz(symbolpic0)(currentpicture); currentpicture := currentpicture shifted (-(w-symbolpicwd0)/2,0); rightgrid_charbox; endchar; beginchar(27,wd#/2,ht#,dp#); "Left end of a wide decrease"; - flipvert(symbolpic0)(currentpicture); currentpicture := currentpicture shifted ((w-symbolpicwd0)/2,0); endchar; + flipvert(symbolpic0)(currentpicture); currentpicture := currentpicture shifted ((w-symbolpicwd0)/2,0); leftgrid_charbox; endchar; beginchar(28,wd#/2,ht#,dp#); "Right end of a wide decrease"; - fliphoriz(symbolpic0)(currentpicture); currentpicture := currentpicture shifted (-(w-symbolpicwd0)/2,0); flipvert(currentpicture)(currentpicture);endchar; + fliphoriz(symbolpic0)(currentpicture); currentpicture := currentpicture shifted (-(w-symbolpicwd0)/2,0); flipvert(currentpicture)(currentpicture); rightgrid_charbox; endchar; beginchar(29,wd#,ht#,dp#); "Middle of a wide increase"; - if fonttype <> purltype: pickup pensquare xscaled wideinctip yscaled wideincline; z1 = (-cableextend,(h-topgap-d+bottomgap)/2); z3 = (w+cableextend,(h-topgap-d+bottomgap)/2); @@ -472,16 +512,12 @@ beginchar(29,wd#,ht#,dp#); "Middle of a wide increase"; fill bot lft z2{up}..bot z1{left}--top z1{right}..top rt z2---bot rt z2--cycle; %draw z3{left}..z2{down}; fill bot rt z2{up}..bot z3{right}--top z3{left}..top lft z2---bot lft z2--cycle; - if gridfont: - if fonttype = gridtype: currentpicture := nullpicture; fi - if (fonttype = gridtype) or (fonttype = bothtype): - pickup pensquare scaled gridwidth; - draw lft (w,h) -- rt (0,h); draw rt (0,-d) -- lft (w,-d); - fi fi fi symbolpic0 := currentpicture; symbolpicwd0 := w; + topbotgrid_charbox; endchar; beginchar(30,wd#,ht#,dp#); "Middle of a wide decrease"; flipvert(symbolpic0)(currentpicture); currentpicture := currentpicture shifted ((w-symbolpicwd0)/2,0); + topbotgrid_charbox; endchar; if 5*wd# < symbolmaxwd#: @@ -498,8 +534,7 @@ beginchar(31,if fonttype = counttype: decrwidth(5,1) else: 5wd# fi,ht#,dp#); "Ma fill bot lft z2---top lft z2..top z4{right}..top lft z1{up}--top rt z1---bot rt z1..bot z4{left }..bot rt z2{down}--cycle; fill bot rt z3---top rt z3..top z5{left }..top rt z1{up}--top lft z1---bot lft z1..bot z5{right}..bot lft z3{down}--cycle; - charbox; - endchar; + charbox; endchar; fi beginchar("~",incrwidth(0,0),ht#,dp#); "Empty box (spacer)"; endchar; @@ -554,11 +589,10 @@ beginchar("M",incrwidth(0,1),ht#,dp#); "Make one purlwise"; % purlbox; endchar; beginchar("|",if fonttype <> counttype: overlinewd# else: 0 fi,ht#,dp#); "Divider"; - if fonttype <> purltype: + if (fonttype = foretype) or (fonttype = bothtype): fill(0,-d-gridwidth/2-purlextend)--(0,h+gridwidth/2+purlextend) --(w,h+gridwidth/2+purlextend)--(w,-d-gridwidth/2-purlextend) --cycle; - if gridfont: if fonttype = gridtype: currentpicture := nullpicture; fi fi fi endchar; @@ -662,8 +696,18 @@ beginchar("<",decrwidth(2,1),ht#,dp#); "SSK or left-slant cable"; symbolpic0 := currentpicture; symbolpicwd0 := w; charbox; endchar; beginchar(">",decrwidth(2,1),ht#,dp#); "k2tog or right-slant cable"; - fliphoriz(symbolpic0)(currentpicture); currentpicture := currentpicture shifted (-(w-symbolpicwd0)/2,0); + fliphoriz(symbolpic0)(currentpicture); + currentpicture := currentpicture shifted (-(w-symbolpicwd0)/2,0); charbox; endchar; + +beginchar("0",incrwidth(1,2),ht#,dp#); "Make 2 from 1"; + flipvert(symbolpic0)(currentpicture); + charbox; endchar; +beginchar("#",incrwidth(1,2),ht#,dp#); "Make 2 from 1"; + flipvert(symbolpic0)(currentpicture); + fliphoriz(currentpicture)(currentpicture); + charbox; endchar; + beginchar(";",decrwidth(2,1),ht#,dp#); "P2tog"; pickup purl_symbol_pen; draw symbolpath0; @@ -811,9 +855,11 @@ beginchar("Y",incrwidth(1,3),ht#,dp#); "Make 3 from 1 with YO center"; beginchar("E",incrwidth(1,3),ht#,dp#); "make 3 from 1 with purl center"; pickup symbol_pen; - if fonttype <> purltype: - currentpicture := symbolpic0; currentpicture := currentpicture shifted ((w-symbolpicwd0)/2,0); - else: + if (fonttype = foretype) or (fonttype = bothtype): + currentpicture := symbolpic0; currentpicture := currentpicture shifted ((w-symbolpicwd0)/2,0); + fi + charbox; + if (fonttype = purltype): z1 = point 0 of symbolpath0; z2 = point 1 of symbolpath0; z3 = point 2 of symbolpath0; @@ -821,6 +867,21 @@ beginchar("E",incrwidth(1,3),ht#,dp#); "make 3 from 1 with purl center"; fi endchar; +beginchar("&",incrwidth(1,3),ht#,dp#); "make 3 from 1 with knit center"; + pickup symbol_pen; + if (fonttype = foretype) or (fonttype = bothtype): + currentpicture := symbolpic0; currentpicture := currentpicture shifted ((w-symbolpicwd0)/2,0); + fi + charbox; + if (fonttype = purltype): + z1 = point 0 of symbolpath0; + z2 = point 1 of symbolpath0; + z3 = point 2 of symbolpath0; + fill z1--z2--z3--%z1--(0,h)-- + (w,h)--(w,-d)--(0,-d)--(0,h)--cycle; + fi + endchar; + beginchar("A",decrwidth(3,1),ht#,dp#); "Make 1 from 3"; pickup symbol_pen; bot lft z1 = (0.5w-0.5 biggerheight-ho,-d+small_bottomgap-o); @@ -940,7 +1001,7 @@ beginchar("a",decrwidth(3,1),ht#,dp#); "LRC"; trianglecharwd# = 19/3 pt#; beginchar("}", trianglecharwd#, 6.25pt#, 0); "Triangle pointing right"; - if (fonttype = foretype) or (fonttype = bothtype) or (fonttype = counttype): + if (fonttype = foretype) or (fonttype = bothtype): x1=x2=w-x3-max(purlextend, 0.5gridwidth)=4/3pt; y3=.5h; y1-y3=y3-y2; y1-y2 = 1.3*(x3-x1); @@ -1084,3 +1145,19 @@ ligtable 18: "1" |=: 18, 18 =:| 17; +% Outlines + +if gridfont: + +beginchar(5,wd#,ht#,dp#); "Top and bottom outlines"; + topbotgrid_charbox; endchar; + +beginchar(6,0,ht#,dp#); "Vertical grid line"; + pickup pensquare scaled gridwidth; + if (fonttype = gridtype) or (fonttype = bothtype): + draw (0,-d)--(0,h); + fi +endchar; + +fi + diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitg_sc_in.mf b/Master/texmf-dist/fonts/source/public/knitting/knitg_sc_in.mf index b0af5c39aa4..c5df48332be 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knitg_sc_in.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knitg_sc_in.mf @@ -1,10 +1,9 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 mode_setup; boolean gridfont; gridfont := true; -boolean slantlines; slantlines = false; -fonttype = counttype; +fonttype = counttype; % Count stitches only -- don't draw anything def incrwidth (expr stsin, stsout) = stsin*wd# enddef; def decrwidth (expr stsin, stsout) = stsin*wd# enddef; diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitg_sc_out.mf b/Master/texmf-dist/fonts/source/public/knitting/knitg_sc_out.mf index 1166146ffcd..3aa0c481f84 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knitg_sc_out.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knitg_sc_out.mf @@ -1,10 +1,9 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 mode_setup; boolean gridfont; gridfont := true; -boolean slantlines; slantlines = false; -fonttype = counttype; +fonttype = counttype; % Count stitches only -- don't draw anything def incrwidth (expr stsin, stsout) = stsout*wd# enddef; def decrwidth (expr stsin, stsout) = stsout*wd# enddef; diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitgg.mf b/Master/texmf-dist/fonts/source/public/knitting/knitgg.mf index 627630fd076..329b3d60dfa 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knitgg.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knitgg.mf @@ -1,8 +1,9 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 mode_setup; boolean gridfont; gridfont := true; +slantcutoff = 2; % Draw slant lines if there are 1 or 2 background cables fonttype = gridtype; % Show grid only input knit_dimens; diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitgn.mf b/Master/texmf-dist/fonts/source/public/knitting/knitgn.mf index c47ef4dc985..0b61cc263c7 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knitgn.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knitgn.mf @@ -1,9 +1,8 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 mode_setup; boolean gridfont; gridfont := true; -boolean slantlines; slantlines = false; fonttype = foretype; % Show symbols only - no grid input knit_dimens; diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitmg.mf b/Master/texmf-dist/fonts/source/public/knitting/knitmg.mf new file mode 100644 index 00000000000..c02a442a5f8 --- /dev/null +++ b/Master/texmf-dist/fonts/source/public/knitting/knitmg.mf @@ -0,0 +1,22 @@ +% Date: 2019/04/05 + +mode_setup; + +boolean gridfont; gridfont := true; +fonttype = gridtype; % Show grid only + +input knit_dimens; + +if known ps_output: + font_identifier := "KnittingSymbols-mixed-grid"; +fi + +string Vtitle; Vtitle := "Knit font with grid and stylized cables"; + +input knit_symbols; + +input knit_nogrid_cables; + +end + + diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitml.mf b/Master/texmf-dist/fonts/source/public/knitting/knitml.mf new file mode 100644 index 00000000000..8fc86426168 --- /dev/null +++ b/Master/texmf-dist/fonts/source/public/knitting/knitml.mf @@ -0,0 +1,27 @@ +% Date: 2019/04/05 + +mode_setup; + +boolean gridfont; gridfont := true; +boolean debugcables; debugcables := false; +fonttype = foretype; % Show symbols + +bottomgap# = standardgap#; +topgap# = ht#-topcableheight#+cablevertgap#; + +input knit_dimens; + +if known ps_output: + font_identifier :="KnittingSymbols-nogrid-lowered"; +fi + +string Vtitle; Vtitle := "Knit font, grid and stylized cable symbols"; + +input knit_symbols; + +pickup symbol_pen; + +input knit_nogrid_cables; + + +end diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitmn.mf b/Master/texmf-dist/fonts/source/public/knitting/knitmn.mf new file mode 100644 index 00000000000..c3832f75826 --- /dev/null +++ b/Master/texmf-dist/fonts/source/public/knitting/knitmn.mf @@ -0,0 +1,22 @@ +% Date: 2019/04/05 + +mode_setup; + +boolean gridfont; gridfont := true; +fonttype = foretype; % Show symbols only - no grid + +input knit_dimens; + +if known ps_output: + font_identifier := "KnittingSymbols-mixed-foreground"; +fi + +string Vtitle; Vtitle := "Knit font with grid and stylized cables"; + +input knit_symbols; + +input knit_nogrid_cables; + +end + + diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitmp.mf b/Master/texmf-dist/fonts/source/public/knitting/knitmp.mf new file mode 100644 index 00000000000..f7cce6c2208 --- /dev/null +++ b/Master/texmf-dist/fonts/source/public/knitting/knitmp.mf @@ -0,0 +1,23 @@ +% Date: 2019/04/05 + +mode_setup; + +boolean gridfont; gridfont := true; +boolean gridcables; gridcables := false; +fonttype = purltype; % Gray purl background + +input knit_dimens; + +if known ps_output: + font_identifier := "KnittingSymbols-mixed-purl"; +fi + +string Vtitle; Vtitle := "Knit font with grid and stylized cables"; + +input knit_symbols; + +input knit_nogrid_cables; + +end + + diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitmr.mf b/Master/texmf-dist/fonts/source/public/knitting/knitmr.mf new file mode 100644 index 00000000000..fb8ec620389 --- /dev/null +++ b/Master/texmf-dist/fonts/source/public/knitting/knitmr.mf @@ -0,0 +1,27 @@ +% Date: 2019/04/05 + +mode_setup; + +boolean gridfont; gridfont := true; +boolean debugcables; debugcables := false; +fonttype = foretype; % Show symbols + +bottomgap# = dp#+botcableheight#+cablevertgap#; +topgap# = standardgap#; + +input knit_dimens; + +if known ps_output: + font_identifier := "KnittingSymbols-mixed-raised"; +fi + +string Vtitle; Vtitle := "Knit font, grid and stylized cable symbols"; + +input knit_symbols; + +pickup symbol_pen; + +input knit_nogrid_cables; + + +end diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitnl.mf b/Master/texmf-dist/fonts/source/public/knitting/knitnl.mf index 6e04a8ee958..0097ee88ad3 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knitnl.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knitnl.mf @@ -1,8 +1,9 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 mode_setup; boolean gridfont; gridfont := false; +boolean debugcables; debugcables := false; fonttype = foretype; % Show symbols bottomgap# = standardgap#; diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitnr.mf b/Master/texmf-dist/fonts/source/public/knitting/knitnr.mf index 081a17f3e2d..5d30c8d1297 100644 --- a/Master/texmf-dist/fonts/source/public/knitting/knitnr.mf +++ b/Master/texmf-dist/fonts/source/public/knitting/knitnr.mf @@ -1,8 +1,9 @@ -% Date: 2010/08/10 +% Date: 2019/04/05 mode_setup; boolean gridfont; gridfont := false; +boolean debugcables; debugcables := false; fonttype = foretype; % Show symbols bottomgap# = dp#+botcableheight#+cablevertgap#; diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitw_sc_in.mf b/Master/texmf-dist/fonts/source/public/knitting/knitw_sc_in.mf deleted file mode 100644 index c7f4cb7534e..00000000000 --- a/Master/texmf-dist/fonts/source/public/knitting/knitw_sc_in.mf +++ /dev/null @@ -1,25 +0,0 @@ -% Date: 2010/08/10 - -mode_setup; - -boolean gridfont; gridfont := true; -fonttype = counttype; - -def incrwidth (expr stsin, stsout) = stsin*wd# enddef; -def decrwidth (expr stsin, stsout) = stsin*wd# enddef; -boolean incrwidthdefined; incrwidthdefined = true; - -wd# = widewd#; -input knit_dimens; - -if known ps_output: - font_identifier := "KnittingSymbols-wide-incount"; -fi - -string Vtitle; Vtitle := "Knit font for checking stitch counts"; - -input knit_symbols; - -input knit_grid_cables; - -end diff --git a/Master/texmf-dist/fonts/source/public/knitting/knitw_sc_out.mf b/Master/texmf-dist/fonts/source/public/knitting/knitw_sc_out.mf deleted file mode 100644 index 9a0dd7c60bc..00000000000 --- a/Master/texmf-dist/fonts/source/public/knitting/knitw_sc_out.mf +++ /dev/null @@ -1,25 +0,0 @@ -% Date: 2010/08/10 - -mode_setup; - -boolean gridfont; gridfont := true; -fonttype = counttype; - -def incrwidth (expr stsin, stsout) = stsout*wd# enddef; -def decrwidth (expr stsin, stsout) = stsout*wd# enddef; -boolean incrwidthdefined; incrwidthdefined = true; - -wd# = widewd#; -input knit_dimens; - -if known ps_output: - font_identifier := "KnittingSymbols-wide-outcount"; -fi - -string Vtitle; Vtitle := "Knit wide font for checking stitch counts"; - -input knit_symbols; - -input knit_grid_cables; - -end -- cgit v1.2.3