diff options
Diffstat (limited to 'Master/texmf-dist/fonts/source/public/boisik/bskbase.mf')
-rw-r--r-- | Master/texmf-dist/fonts/source/public/boisik/bskbase.mf | 170 |
1 files changed, 135 insertions, 35 deletions
diff --git a/Master/texmf-dist/fonts/source/public/boisik/bskbase.mf b/Master/texmf-dist/fonts/source/public/boisik/bskbase.mf index 436053a6431..da24993fd16 100644 --- a/Master/texmf-dist/fonts/source/public/boisik/bskbase.mf +++ b/Master/texmf-dist/fonts/source/public/boisik/bskbase.mf @@ -11,14 +11,19 @@ def autorounded = interim autorounding:=2 enddef; newinternal slant,fudge,math_spread,superness,superpull,beak_darkness,ligs; boolean square_dots,hefty,serifs, medieval, monofig, bulbes, - monospace,variant_g,low_asterisk,math_fitting; - + monospace,variant_g,low_asterisk,math_fitting, testdpi, boldmath; + + boldmath:=false; + boolean dark,dark.dark,skewed,skewed.skewed; % for fast option testing dark=skewed=false; dark.dark=skewed.skewed=true; def infill text t:= cullit; path _p; _p:=t; erase fill _p; draw _p; enddef; +def dinfill text t:= erase draw t; +enddef; + let bskboundary=relax; vardef Vround primary y = y_:=vround y; @@ -43,13 +48,13 @@ def beginarithchar(expr c) = % ensure consistent dimensions for $+$, $-$, etc. italcorr math_axis#*slant-.5u#; adjust_fit(0,0); enddef; -boolean test, test.alt; test=false; test.alt=true; +boolean test, test.alt, test.nodraw; test=false; test.alt=true; test.nodraw:=true; %%%%%%%%%%%Dots and commas def dot(suffix $):= - filldraw if square_dots: unitsquare shifted (.5,.5) scaled dot_size - else: fullcircle scaled dot_size shifted z$ - fi; + filldraw if square_dots: ((.5,.25)..(-.5,.25)---(-.5,-.25)..(0,-.5)..(.5,-.25)---cycle) scaled dot_size + else: fullcircle scaled dot_size + fi shifted z$; labels($); enddef; @@ -221,16 +226,16 @@ def ital_hook(suffix $,$$)suffix modifier:= pos$$(hair,150); pos$'(.5[hair,stem],90); penlabels($$,$'); z$$'=z$$r+hair*up; labels($$'); path _ih; - _ih:=z$l{down}..z$'l..z$$l if test.modifier and (dpi<=300):-- else:..z$$'&z$$'..fi z$$r..z$'r..{up}z$r; + _ih:=z$l{down}..z$'l..z$$l if test.modifier and testdpi:-- else:..z$$'&z$$'..fi z$$r..z$'r..{up}z$r; enddef; -def ital_kooh(suffix $,$$):= +def ital_kooh(suffix $,$$)suffix modifier:= if not known x$$r: x$$r=0; fi y$$=H-.25bar_height; top y$'r=H+o; x$'=.45[x$,x$$]; pos$$(hair,150); pos$'(.5[hair,stem],100); penlabels($$,$'); z$$'=z$$l+hair*dir(-110); labels($$'); path _ik; - _ik:=z$r{up}..z$'r..z$$r{dir-120}..z$$'&z$$'..z$$l{dir60}..z$'l..{down}z$l; + _ik:=z$r{up}..z$'r..{dir-120}z$$r if test.modifier and testdpi:-- else: ..z$$'--z$$'+right..fi z$$l{dir60}..z$'l..{down}z$l; enddef; %%%%%%%%Arms @@ -326,8 +331,11 @@ numeric uniproc; uniproc:=0; def uni text t:= charuni:=t; + if t<>"non": t; fi enddef; +def unitext(text t):= enddef; + extra_beginchar:=extra_beginchar&"charuni:=empty; numeric oblu; oblu:=f_obl;"; %%%%%%Rounding @@ -339,6 +347,30 @@ def obl(suffix $,$$,$$$)suffix modifier:= % rounded corners fi enddef; +def tobl(suffix $,$$,$$$)suffix modifier:= % rounded corners + if monospace and ((stem-hair)<.2hair): + z$ + else: + if (abs(z$$-z$)>oblu.modifier): + z$+(oblu.modifier,0) rotated(angle(z$$-z$)) + else: + .5[z$,z$$]{z$-z$$} + fi + ... + if (abs(z$$$-z$)>oblu.modifier): + z$+(oblu.modifier,0) rotated(angle(z$$$-z$)) + else: + {z$$$-z$}.5[z$,z$$$] + fi + fi +enddef; + +def ifobl(suffix $,$$,@,@@,#,##):= %rounded pair of corners + if abs(z$-z$$)>oblu.#+oblu.##: obl($,@,$$).#---obl($$,$,@@).## + else: z$+(oblu.#,0) rotated(angle(z@-z$))... {z$$-z$}.5[z$,z$$]...z$$+(oblu.##,0) rotated(angle(z@@-z$$)) + fi +enddef; + boolean smer, smer.zpet; smer:=true; smer.zpet:=false; vardef rundy(expr p, t)suffix modifier:= %rounded paths numeric _rnd, _rndb, _oblu; @@ -359,7 +391,7 @@ vardef rundy(expr p, t)suffix modifier:= %rounded paths enddef; vardef bsktouch(expr _pa,_dira,_pb,_dirb):= - ((_pa shifted (.5currentbreadth*_dira)) intersectionpoint (_pb shifted (.5currentbreadth*_dirb))) + ((_pa shifted (max(1,.5currentbreadth)*_dira)) intersectionpoint (_pb shifted (max(1,.5currentbreadth)*_dirb))) enddef; %%%%%%Symbols @@ -398,10 +430,10 @@ vardef bskfrenchr(suffix $,$$):= %Reversed french quote penlabels($,$',$$); enddef; -def less(suffix @,$,$$):= - numeric _theta; +def less(suffix @,$,$$)suffix modifier:= + numeric _theta; path _less; pos@(rule_thickness,0); x$=x$$; .5[y$r,y$$r]=y@; - if (unknown y$) and (unknown y$$): y$r=h+.5rule_thickness; fi; + if (unknown y$r) and (unknown y$$r): y$r=h-.5rule_thickness; fi; if (unknown x$r) and (unknown x$$r): x$r=w-x@l; fi; _theta:=angle(z$r-z@r); pos$(rule_thickness,_theta-90); pos$$(rule_thickness,_theta+45); @@ -410,14 +442,15 @@ def less(suffix @,$,$$):= z@'''=whatever[z@',z$r]=whatever[z@'',z$$r]; y@l'=y@l+o; z@l'=whatever[z@l,z$l]; bskpoints(@,$,hair,hair); - filldraw z@l..z@l'---z$ll..z$r---obl(@''',$r,$$r)---z$$r..z$$l---cycle; + _less:=z@l..z@l'---z$ll..z$r---obl(@''',$r,$$r)---z$$r..z$$l; + if not test.modifier: filldraw _less---cycle; fi; penlabels(@,$,$$); labels(@',@'',@''',$ll,@l'); enddef; -def greater(suffix @,$,$$):= - numeric _theta; - pos@(rule_thickness,0); x$=x$$; .5[y$r,y$$r]=y@; - if (unknown y$) and (unknown y$$): y$l=h; fi; +def greater(suffix @,$,$$)suffix modifier:= + numeric _theta; path _greater; + pos@(rule_thickness,0); x$=x$$; .5[y$l,y$$l]=y@; + if (unknown y$l) and (unknown y$$l): y$l=h-.5rule_thickness; fi; if (unknown x$l) and (unknown x$$l): x$l=w-x@r; fi; _theta:=angle(z$l-z@r); pos$(rule_thickness,_theta-90); pos$$(rule_thickness,_theta-45); @@ -426,14 +459,15 @@ def greater(suffix @,$,$$):= z@'''=whatever[z@',z$r]=whatever[z@'',z$$r]; y@r'=y@r+o; z@r'=whatever[z@r,z$r]; bskpoints($,@,hair,hair); - filldraw z@r..z@r'---z$rr..z$l---obl(@''',$l,$$r)---z$$r..z$$l---cycle; + _greater:=z@r..z@r'---z$rr..z$l---obl(@''',$l,$$r)---z$$r..z$$l; + if not test.modifier: filldraw _greater---cycle; fi; penlabels(@,$,$$); labels(@',@'',@''',$rr,@r'); enddef; -def logor(suffix @,$,$$):= %Logical or shape - numeric _theta; +def logor(suffix @,$,$$)suffix modifier:= %Logical or shape + numeric _theta; path _logor; pos@(rule_thickness,90); y$=y$$; .5[x$l,x$$l]=x@; - if (unknown y$) and (unknown y$$): y$l=h; fi; + if (unknown y$l) and (unknown y$$): y$l=h; fi; if unknown x$l: lft x$l=u; fi; _theta:=angle(z$l-z@l); pos$(rule_thickness,_theta-90); pos$$(rule_thickness,_theta+45); @@ -442,14 +476,15 @@ def logor(suffix @,$,$$):= %Logical or shape z@'''=whatever[z@',z$r]=whatever[z@'',z$$r]; x@l'=x@l-o; z@l'=whatever[z@l,z$l]; bskpoints(@,$,hair,hair); - filldraw z@l..z@l'---z$ll..z$r---obl(@''',$r,$$r)---z$$r..z$$l---cycle; + _logor:=z@l..z@l'---z$ll..z$r---obl(@''',$r,$$r)---z$$r..z$$l; + if not test.modifier: filldraw _logor---cycle; fi; penlabels(@,$,$$); labels(@',@'',@''',$ll,@l'); enddef; -def logand(suffix @,$,$$):= %Logical and shape - numeric _theta; +def logand(suffix @,$,$$)suffix modifier:= %Logical and shape + numeric _theta; path _logand; pos@(rule_thickness,90); y$=y$$; .5[x$r,x$$r]=x@; - if (unknown y$) and (unknown y$$): y$r=-d; fi; + if (unknown y$r) and (unknown y$$): y$r=-d; fi; if unknown x$r: lft x$r=u; fi; _theta:=angle(z$r-z@r); pos$(rule_thickness,_theta-90); pos$$(rule_thickness,_theta-45); @@ -458,7 +493,8 @@ def logand(suffix @,$,$$):= %Logical and shape z@'''=whatever[z@',z$l]=whatever[z@'',z$$r]; x@r'=x@r-o; z@r'=whatever[z@r,z$r]; bskpoints(@,$,hair,hair); - filldraw z@r..z@r'---z$r...z$ll---obl(@''',$l,$$r)---z$$r..z$$l---cycle; + _logand:=z@r..z@r'---z$r...z$ll---obl(@''',$l,$$r)---z$$r..{z@r-z$$l}z$$l; + if not test.modifier: filldraw _logand---cycle; fi; penlabels(@,$,$$); labels(@',@'',@''',$ll,@r'); enddef; @@ -480,7 +516,7 @@ def draw_circle suffix smer:= z8.smer{right}...z1.smer{z2-z8}...z2.smer{down}...z3.smer{z4-z2}...z4.smer{left}...z5.smer{z6-z4}...z6.smer{up}...z7.smer{z8-z6}...cycle enddef; -vardef vlnka(suffix $,$$):= +vardef vlnka_points(suffix $,$$):= y$a.l=y$$; y$$a.r=y$; .5[x$,x$$]=.5[x$a,x$$a]=.5w; if unknown x$ : lft x$ =u; fi; top y$$- bot y$= spread; @@ -488,11 +524,36 @@ vardef vlnka(suffix $,$$):= x$$-x$$a=1/4(x$$-x$); pos$(hair,0); pos$$(hair,0); pos$a(curve,290); pos$$a(curve,250); z$$a.s=z$$a.r+curve*unitvector(z$$-z$); - filldraw z$r{z$a-z$}..z$a.r..z$$a.r..z$$a.s..{z$$-z$$a.r}z$$r.. - z$$l{z$$a-z$$}..z$$a.l..z$a.l..{z$-z$a.l}z$l..cycle; penlabels($,$a,$$,$$a); labels($$a.s); enddef; +vardef vlnka(suffix $,$$)suffix modifier:= + vlnka_points($,$$); + path _vlnka; + _vlnka:=z$r{z$a-z$}..z$a.r..z$$a.r..z$$a.s..{z$$-z$$a.r}z$$r.. + z$$l{z$$a-z$$}..z$$a.l..z$a.l..{z$-z$a.l}z$l..{z$a-z$}z$r; + if not test.modifier: filldraw _vlnka..cycle; fi; +enddef; + +vardef vlnka_inv_points(suffix $,$$):= + y$a.r=y$$; y$$a.l=y$; .5[x$,x$$]=.5[x$a,x$$a]=.5w; + if unknown x$ : lft x$ =u; fi; + top y$- bot y$$= spread; + if unknown y$: top y$=h; fi + x$$-x$$a=1/4(x$$-x$); + pos$(hair,180); pos$$(hair,180); pos$a(curve,250); pos$$a(curve,290); + z$$a.s=z$$a.l+curve*unitvector(z$$-z$); + penlabels($,$a,$$,$$a); labels($$a.s); +enddef; + +vardef vlnka_inv(suffix $,$$)suffix modifier:= + vlnka_inv_points($,$$); + path _vlnka_inv; + _vlnka_inv:=z$r{z$a-z$}..z$a.r..z$$a.r..{z$$-z$$a.r}z$$r.. + z$$l{z$$a-z$$}..z$$a.s...z$$a.l..z$a.l..{z$-z$a.l}z$l..{z$a-z$}z$r; + if not test.modifier: filldraw _vlnka_inv..cycle; fi; +enddef; + def sipka_points(suffix $,$$):= numeric bskaw, bskat, bsktim[]; bskaw=abs(z$$l-z$$r)+currentbreadth; pair bskadir; bskadir=unitvector(z$-z$$r); bskat=angle(bskadir); @@ -568,6 +629,41 @@ vardef dvojsipka(suffix $,$$,@,@@):= subpath(rundy(bskap0,bsktim17),infinity) of bskap0 enddef; +vardef whitehead(suffix $,$$,@,@@):= + z$'=z$+(rule_thickness-currentbreadth)*dir(bskat+180); + path _whp[]; numeric _wht[]; + _whp0:=z$'{dir(bskat+180)}..{dir(bskat+160)}point bsktim12 of bskap3; + _whp1:=(bskap0 intersectionpoint (z@@r--z@@r+(z$-z$$))){dir(bskat+20)}..{dir(bskat)}z$'; + (_wht0,_wht1)=(_whp0 shifted ((max(1,.5currentbreadth))*dir(bskat-90))) + intersectiontimes (_whp1 shifted ((max(1,.5currentbreadth))*dir(bskat+90))); + labels($',$''); + subpath(rundy(_whp1,0),rundy(_whp1,_wht1).zpet) of _whp1 + ..subpath(rundy(_whp0,_wht0),rundy(_whp0,infinity).zpet) of _whp0 +enddef; + +vardef trojsipka(suffix $,$$,@,@@):= + sipka_points($,$$); + dvojsipka_points($,$$,@,@@); + oblu:=f_obl; + penlabels(@,@@); + bskap7=(x$$,y$d)--z$d; + bskap8=z$$l+(z$-z$$r)--z$$l; + (bsktim19,bsktim20)=bskap0 intersectiontimes bskap8; + subpath(0,rundy(bskap7,infinity).zpet) of bskap7.. + subpath(rundy(bskap1,0),rundy(bskap1,bsktim11).zpet) of bskap1.. + subpath(rundy(bskap3,bsktim12),infinity) of bskap3.. + subpath(0,rundy(bskap4,bsktim14).zpet) of bskap4.. + subpath(rundy(bskap1,bsktim13),infinity) of bskap1 + &z$e+(hair*down rotated bskat){dir(bskat+135)}..z$e{dir(bskat-45)}.. + {dir(bskat-30)}z${dir(bskat-160)}..{dir(bskat-135)}z$b.. + {dir(bskat+45)}z$b+(hair*up rotated bskat)& + subpath(0,rundy(bskap0,bsktim15).zpet) of bskap0.. + subpath(rundy(bskap5,bsktim16),infinity) of bskap5.. + subpath(0,rundy(bskap6,bsktim18).zpet) of bskap6.. + subpath(rundy(bskap0,bsktim17),rundy(bskap0,bsktim19).zpet) of bskap0.. + subpath(rundy(bskap8,bsktim20),infinity) of bskap8 +enddef; + %%%%%%%%%%Accents boolean capital, capital.capital; capital:=false; capital.capital:=true; @@ -733,7 +829,7 @@ newinternal l,r,shrink_fit; % adjustments to spacing def charscription(expr width, height, depth)(text t):= def _saved_char := t; enddef; - _saved_w:=width; _saved_h:=height; _saved_d:=depth; + _saved_w:=width; _saved_u:=u; _saved_h:=height; _saved_d:=depth; let bskcharscriptcmd=relax; enddef; @@ -749,7 +845,7 @@ def usechar text t= WW:=w; HH:=h; DD:=d; if not monospace: save w,h,d; numeric w,h,d; - w=_saved_w; h=_saved_h; d=_saved_d; + w=(u/_saved_u)*_saved_w; h=_saved_h; d=_saved_d; else: save h,d; numeric h,d; h=_saved_h; d=_saved_d; @@ -903,7 +999,8 @@ def font_setup = enddef; def filldraw text t:= bsk_savepen; path _bp; _bp:=t; bskfilldraw _bp; cullit; pickup bskoutlinepen.nib; erase bskfilldraw _bp; cullit; bsk_restorepen; enddef; fi; - if not known dpi: begingroup interim warningcheck:=0; numeric dpi; dpi:=pixels_per_inch; endgroup; fi; + begingroup interim warningcheck:=0; testdpi:=(pixels_per_inch<=300); endgroup; + if unknown bbw: numeric bbw; bbw:=curve; fi %For blackboard-bold letters enddef; vardef clockwise primary c = @@ -920,11 +1017,14 @@ def makebox(text rule) = for y=0,asc_height,body_height,x_height,bar_height,-desc_depth,-body_depth: rule((l,y)t_,(r,y)t_); endfor % horizontals for x=l,r: rule((x,-body_depth)t_,(x,body_height)t_); endfor % verticals - rule((r,-body_depth),(r,body_height)); + rule((r,-max(body_depth,d)),(r,body_height)); for x=u*(1+floor(l/u)) step u until r-1: rule((x,-body_depth)t_,(x,body_height)t_); endfor % more verticals if charic<>0: - rule((r+charic*pt,h.o_),(r+charic*pt,.5h.o_)); fi % italic correction + rule((r+charic*pt,h.o_),(r+charic*pt,.5h.o_)); + if h=0: rule((r+charic*pt,0),(r+charic*pt,-.5d.o_)); fi + fi % italic correction +for y=math_axis,-d,h: rule((l-3u,y)t_,(r+3u,y)t_); endfor enddef; def maketicks(text rule) = for y=0,h.o_,-d.o_: |