diff options
Diffstat (limited to 'Master/texmf-dist/fonts/source/public/knitting/knit_nogrid_cables.mf')
-rw-r--r-- | Master/texmf-dist/fonts/source/public/knitting/knit_nogrid_cables.mf | 433 |
1 files changed, 374 insertions, 59 deletions
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,16 +200,25 @@ 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"; currentpicture := symbolpic0; @@ -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 |