summaryrefslogtreecommitdiff
path: root/tex/context/third/cyrillicnumbers/t-cyrillicnumbers.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/third/cyrillicnumbers/t-cyrillicnumbers.mkiv')
-rw-r--r--tex/context/third/cyrillicnumbers/t-cyrillicnumbers.mkiv265
1 files changed, 265 insertions, 0 deletions
diff --git a/tex/context/third/cyrillicnumbers/t-cyrillicnumbers.mkiv b/tex/context/third/cyrillicnumbers/t-cyrillicnumbers.mkiv
new file mode 100644
index 0000000..5ebaf29
--- /dev/null
+++ b/tex/context/third/cyrillicnumbers/t-cyrillicnumbers.mkiv
@@ -0,0 +1,265 @@
+%D \module
+%D [ file=t-cyrillicnumbers,
+%D version=2011-11-29 09:58:48+0100,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Cyrillic Number Module,
+%D author=Philipp Gesang,
+%D date=\currentdate,
+%D copyright=Philipp Gesang,
+%D license=2-clause BSD,
+%D email={gesang at stud dot uni-heidelberg dot de}]
+%D This module is licensed under the conditions of the BSD license with
+%D two clauses. There is a copy in a file named "COPYING" in the
+%D t-cyrillicnumbers source tree.
+
+\writestatus{loading}{Cyrillic Number Support for ConTeXt}
+
+\unprotect
+
+\definenamespace [cyrnum] [
+ name=cyrnum,
+ type=module,
+ setup=list,
+ parent=cyrnum,
+ style=no,
+ version=hg-tip,
+ comment=cyrillic numbers,
+]
+
+\registerctxluafile{cyrillicnumbers}
+
+\enablemode[cyrnum-titlo9]
+
+\def\cyrnum_penwidth{12}
+
+\startuniqueMPgraphic{cyrnum-titlo1}
+ path titlo ;
+ save High, Low ;
+ save Vfactor ; Vfactor = .15 ;
+ save Hfactor ; Hfactor = .90 ;
+ titlo := ( 0.00, -Vfactor) ..
+ ( 0.05, .4*Vfactor) ..
+ ( 0.95, -.4*Vfactor) ..
+ ( 1.00, Vfactor) ;
+ pickup pensquare yscaled \cyrnum_penwidth xscaled 1 rotated -30 ;
+ draw titlo
+ xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
+ shifted (.5*(OverlayWidth-Hfactor*OverlayWidth),OverlayHeight-Vfactor*OverlayHeight) ;
+ setbounds currentpicture to boundingbox OverlayBox ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{cyrnum-titlo2}
+ path titlo ;
+ save penwidth ; penwidth = \cyrnum_penwidth ;
+ save High, Low ;
+ save Vfactor ; Vfactor = .15 ;
+ save Hfactor ; Hfactor = .80 ;
+ titlo := ( 0.05, -Vfactor) --
+ ( 0.07, .7*Vfactor) ..
+ ( 0.09, .8*Vfactor) ..
+ ( 0.91, -.8*Vfactor) ..
+ ( 0.93, -.7*Vfactor) --
+ ( 0.95, Vfactor) ;
+ pickup pensquare yscaled penwidth xscaled 1 rotated 70 ;
+ draw titlo
+ xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
+ shifted (.5*(OverlayWidth-Hfactor*OverlayWidth)-.5*penwidth,OverlayHeight-Vfactor*OverlayHeight) ;
+ setbounds currentpicture to boundingbox OverlayBox ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{cyrnum-titlo3}
+ path titlo ;
+ save penwidth ; penwidth = \cyrnum_penwidth ;
+ save High, Low ;
+ save Vfactor ; Vfactor = .15 ;
+ save Hfactor ; Hfactor = .80 ;
+ titlo := ( 0.05, -Vfactor) --
+ ( 0.07, 0.70*Vfactor) ..
+ ( 0.09, 0.90*Vfactor) .. { dir 00 }
+ ( 0.49, -0.00*Vfactor) --
+ ( 0.49, -0.90*Vfactor) --
+ ( 0.51, 0.90*Vfactor) --
+ ( 0.51, 0.00*Vfactor) { dir 00 } ..
+ ( 0.91, -0.90*Vfactor) ..
+ ( 0.93, -0.70*Vfactor) --
+ ( 0.95, Vfactor) ;
+ pickup pensquare yscaled penwidth xscaled 1 rotated 70 ;
+ draw titlo
+ xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
+ shifted (.5*(OverlayWidth-Hfactor*OverlayWidth)-.5*penwidth,OverlayHeight-Vfactor*OverlayHeight) ;
+ setbounds currentpicture to boundingbox OverlayBox ;
+\stopuniqueMPgraphic
+
+%%% Same as 2 with inner vertical stroke
+\startuniqueMPgraphic{cyrnum-titlo4}
+ path titlo, stroke ;
+ save penwidth ; penwidth = \cyrnum_penwidth ;
+ save High, Low ;
+ save Vfactor ; Vfactor = .15 ;
+ save Hfactor ; Hfactor = .80 ;
+ titlo = ( 0.05, -1.00*Vfactor) --
+ ( 0.07, 0.70*Vfactor) ..
+ ( 0.09, 0.90*Vfactor) { dir 00 } .. { dir 00 }
+ ( 0.91, -0.90*Vfactor) ..
+ ( 0.93, -0.70*Vfactor) --
+ ( 0.95, 1.00*Vfactor) ;
+ stroke = ( 0.49*Hfactor*OverlayWidth+.5*penwidth, -0.30*Vfactor*OverlayHeight ) -- %% this is a mess
+ ( 0.51*Hfactor*OverlayWidth+.5*penwidth, 0.50*Vfactor*OverlayHeight ) ;
+ pickup pensquare yscaled penwidth xscaled 1 rotated 80 ;
+ draw titlo
+ xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
+ shifted (.5*(OverlayWidth-Hfactor*OverlayWidth)-.5*penwidth,OverlayHeight-Vfactor*OverlayHeight) ;
+ draw stroke
+ % xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight) %% doesn’t work as expected somehow
+ shifted (.5*(OverlayWidth-Hfactor*OverlayWidth)-.5*penwidth,OverlayHeight-Vfactor*OverlayHeight) ;
+ setbounds currentpicture to boundingbox OverlayBox ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{cyrnum-titlo5}
+ path titlo ;
+ save penwidth ; penwidth = \cyrnum_penwidth ;
+ save High, Low ;
+ save Vfactor ; Vfactor = .20 ;
+ save Hfactor ; Hfactor = .85 ;
+ titlo := ( 0.00, -0.8*Vfactor) {dir 90} .. {dir 90}
+ ( 1.00, 1.2*Vfactor) ;
+ pickup pensquare yscaled penwidth xscaled 2 rotated 85 ;
+ draw titlo
+ xysized (Hfactor*OverlayWidth-.5*penwidth,Vfactor*OverlayHeight)
+ shifted (.5*(OverlayWidth-Hfactor*OverlayWidth),OverlayHeight-Vfactor*OverlayHeight) ;
+ setbounds currentpicture to boundingbox OverlayBox ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{cyrnum-titlo6}
+ path titlo ;
+ save penwidth ; penwidth = \cyrnum_penwidth ;
+ save High, Low ;
+ save Vfactor ; Vfactor = .20 ;
+ save Hfactor ; Hfactor = .85 ;
+ titlo := ( 0.03, -0.80*Vfactor) --
+ ( 0.03, 0.15*Vfactor) --
+ ( 0.00, 0.20*Vfactor) {right} .. {right}
+ ( 1.00, -0.20*Vfactor) --
+ ( 0.97, -0.15*Vfactor) --
+ ( 0.97, 0.80*Vfactor) ;
+ pickup pensquare yscaled penwidth xscaled sqrt(2) rotated 90 ;
+ draw titlo
+ xysized (Hfactor*OverlayWidth-.5*penwidth,Vfactor*OverlayHeight)
+ shifted (.5*(OverlayWidth-Hfactor*OverlayWidth),OverlayHeight-(0.5*Vfactor*OverlayHeight)) ;
+ setbounds currentpicture to boundingbox OverlayBox ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{cyrnum-titlo7}
+ path titlo ;
+ save penwidth ; penwidth = \cyrnum_penwidth ;
+ save High, Low ;
+ save Vfactor ; Vfactor = .20 ;
+ save Hfactor ; Hfactor = .85 ;
+ titlo := ( 0.05, -0.80*Vfactor) --
+ ( 0.05, -0.30*Vfactor) {up} .. {right}
+ ( 0.07, -0.00*Vfactor) --
+ ( 0.93, 0.00*Vfactor) {right} .. {up}
+ ( 0.95, 0.30*Vfactor) --
+ ( 0.95, 0.80*Vfactor) ;
+ pickup pensquare yscaled (0.66*penwidth) xscaled penwidth ;
+ draw titlo
+ xysized (Hfactor*OverlayWidth-2*penwidth,Vfactor*OverlayHeight)
+ shifted ((.5*penwidth+.5*(OverlayWidth-Hfactor*OverlayWidth)),
+ (OverlayHeight-(0.7*Vfactor*OverlayHeight))) ;
+ setbounds currentpicture to boundingbox OverlayBox ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{cyrnum-titlo8}
+ path titlo, stroke ;
+ save penwidth ; penwidth = \cyrnum_penwidth ;
+ save High, Low ;
+ save Vfactor ; Vfactor = .20 ;
+ save Hfactor ; Hfactor = .85 ;
+ titlo := ( 0.15, -0.10*Vfactor) {dir 25} ..% tension 8 ..
+ controls (0.40, 0.50) and (0.00, 0.35) ..
+ ( 0.00, -0.00*Vfactor) {down} ..
+ controls (0.00, -0.30) and (0.10, -0.25) ..
+ % ( 0.10, -0.20*Vfactor) {right} .. tension 4 .. {dir -120}
+ ( 0.30, -0.90*Vfactor) ..
+ controls
+ ( 0.70, 0.20*Vfactor) and
+ ( 0.97, 0.08*Vfactor) ..
+ ( 0.97, -0.30*Vfactor) .. tension 6 .. {dir -140}
+ ( 0.95, -0.90*Vfactor) ;
+ stroke := ((0.45*Hfactor*OverlayWidth),-0.20*Vfactor*OverlayHeight) ..
+ ((0.54*Hfactor*OverlayWidth), 0.35*Vfactor*OverlayHeight) ---
+ ((0.65*Hfactor*OverlayWidth), 0.90*Vfactor*OverlayHeight) {dir -120} .. {dir 30}
+ % ((0.54*Hfactor*OverlayWidth), 0.35*Vfactor*OverlayHeight) ..
+ ((0.45*Hfactor*OverlayWidth), 0.90*Vfactor*OverlayHeight)
+ ;
+ pickup pensquare yscaled 2 xscaled (0.5*penwidth) rotated 10;
+ % pickup pensquare yscaled 1 xscaled 2 ;
+ draw titlo
+ xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
+ shifted ((.5*(OverlayWidth-Hfactor*OverlayWidth)),
+ (OverlayHeight-(0.7*Vfactor*OverlayHeight))) ;
+ pickup pensquare yscaled 2 xscaled (0.5*penwidth) rotated 70;
+ draw stroke
+ % xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
+ shifted ((.6*(OverlayWidth-Hfactor*OverlayWidth)),
+ (OverlayHeight-Vfactor*OverlayHeight))
+ ;
+ setbounds currentpicture to boundingbox OverlayBox ;
+\stopuniqueMPgraphic
+
+\startuniqueMPgraphic{cyrnum-titlo9}
+ path titlo ;
+ save penwidth ; penwidth = \cyrnum_penwidth ;
+ save High, Low ;
+ save Vfactor ; Vfactor = .10 ;
+ save Hfactor ; Hfactor = .85 ;
+ titlo := ( 0.05, -0.40*Vfactor) --
+ ( 0.05, 0.00*Vfactor) --
+ ( 0.95, 0.00*Vfactor) --
+ ( 0.95, -0.40*Vfactor) ;
+ pickup pensquare yscaled (2*penwidth/3) xscaled penwidth ;
+ draw titlo
+ xysized (Hfactor*OverlayWidth-2*penwidth,Vfactor*OverlayHeight)
+ shifted ((.5*penwidth+.5*(OverlayWidth-Hfactor*OverlayWidth)),
+ (OverlayHeight-(0.7*Vfactor*OverlayHeight))) ;
+ setbounds currentpicture to boundingbox OverlayBox ;
+\stopuniqueMPgraphic
+
+\startmode[cyrnum-titlo1]
+ \defineoverlay[cyrnum-titlo-overlay][\uniqueMPgraphic{cyrnum-titlo1}]
+\stopmode %%% titlo1
+\startmode[cyrnum-titlo2]
+ \defineoverlay[cyrnum-titlo-overlay][\uniqueMPgraphic{cyrnum-titlo2}]
+\stopmode
+\startmode[cyrnum-titlo3]
+ \defineoverlay[cyrnum-titlo-overlay][\uniqueMPgraphic{titlo3}]
+\stopmode
+\startmode[cyrnum-titlo4]
+ \defineoverlay[cyrnum-titlo-overlay][\uniqueMPgraphic{cyrnum-titlo4}]
+\stopmode
+\startmode[cyrnum-titlo5]
+ \defineoverlay[cyrnum-titlo-overlay][\uniqueMPgraphic{cyrnum-titlo5}]
+\stopmode
+\startmode[cyrnum-titlo6]
+ \defineoverlay[cyrnum-titlo-overlay][\uniqueMPgraphic{cyrnum-titlo6}]
+\stopmode
+\startmode[cyrnum-titlo7]
+ \defineoverlay[cyrnum-titlo-overlay][\uniqueMPgraphic{cyrnum-titlo7}]
+\stopmode
+\startmode[cyrnum-titlo8]
+ \defineoverlay[cyrnum-titlo-overlay][\uniqueMPgraphic{cyrnum-titlo8}]
+\stopmode
+\startmode[cyrnum-titlo9]
+ \defineoverlay[cyrnum-titlo-overlay][\uniqueMPgraphic{cyrnum-titlo9}]
+\stopmode
+
+\defineframed[cyrnum_titloframe][
+ location=low,
+ frame=off,
+ background=cyrnum-titlo-overlay,
+]
+
+\def\Titlo{\dontleavehmode\cyrnum_titloframe}
+
+\unprotect \endinput
+