sign

Créer des signatures type unistra - retour accueil

git clone git://bebou.netlib.re/sign

Log | Files | Refs | README |

commit 1b68ccb24c7fbe06529a8ee7f0cc20372802efb9
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Tue,  6 May 2025 22:50:01 +0200

Le début

Diffstat:
AREADME | 1+
Adnum.sign | 3+++
Asign | 25+++++++++++++++++++++++++
3 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/README b/README @@ -0,0 +1 @@ +Un dépôt pour générer le squelette d'une signature Unistra diff --git a/dnum.sign b/dnum.sign @@ -0,0 +1,3 @@ + | | +| | | | +|| | diff --git a/sign b/sign @@ -0,0 +1,25 @@ +#! awk -f + +BEGIN { atom=10;width=atom;height=atom*2;x=0;y=0;inrect=0;print "<svg xmlns='http://www.w3.org/2000/svg' >" } +{ + split($0,a,""); + fin=length(a); + for (i=1;i<=fin;i++) { + if (a[i]==" " && !inrect) { x=x+atom; } + else if (a[i]==" " && inrect) { width=width+atom;} + else if (a[i]=="|" && !inrect) { inrect=1; } + else if (a[i]=="|" && inrect) { + printf "<rect width='%s' height='%s' x='%s' y='%s' fill='white' stroke='black' stroke-width='0.1' />\n",width,height,x,y; + x=x+width; + width=atom; + } + } + y=y+height; + width=atom; + inrect=0; + x=0; +} +END { print "</svg>" } +# | | +#| | | | +#|| |