Commit 1ceb1635 authored by alexandre's avatar alexandre

Merge branch 'master' of gitlab.constantvzw.org:osp/workshop.metahoguet

parents 62d137cb 2003023c
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: -3 -3 32 3
%%HiResBoundingBox: -2.83464 -2.83464 31.18105 2.83464
%%Creator: MetaPost 1.9991
%%CreationDate: 2016.11.10:2029
%%Pages: 1
%%DocumentResources: procset mpost-minimal
%%DocumentSuppliedResources: procset mpost-minimal
%%EndComments
%%BeginProlog
%%BeginResource: procset mpost-minimal
/bd{bind def}bind def/fshow {exch findfont exch scalefont setfont show}bd
/fcp{findfont dup length dict begin{1 index/FID ne{def}{pop pop}ifelse}forall}bd
/fmc{FontMatrix dup length array copy dup dup}bd/fmd{/FontMatrix exch def}bd
/Amul{4 -1 roll exch mul 1000 div}bd/ExtendFont{fmc 0 get Amul 0 exch put fmd}bd
/ScaleFont{dup fmc 0 get Amul 0 exch put dup dup 3 get Amul 3 exch put fmd}bd
/SlantFont{fmc 2 get dup 0 eq{pop 1}if Amul FontMatrix 0 get mul 2 exch put fmd}bd
%%EndResource
%%EndProlog
%%BeginSetup
%%EndSetup
%%Page: 1 1
0 0 0 setrgbcolor 0 5.66928 dtransform truncate idtransform setlinewidth pop
[] 0 setdash 1 setlinecap 1 setlinejoin 10 setmiterlimit
newpath 0 0 moveto
28.3464 0 lineto stroke
showpage
%%EOF
This diff is collapsed.
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: -3 -3 38 38
%%HiResBoundingBox: -2.83464 -2.83464 37.05177 37.05177
%%Creator: MetaPost 1.9991
%%CreationDate: 2016.11.10:2029
%%Pages: 1
%%DocumentResources: procset mpost-minimal
%%DocumentSuppliedResources: procset mpost-minimal
%%EndComments
%%BeginProlog
%%BeginResource: procset mpost-minimal
/bd{bind def}bind def/fshow {exch findfont exch scalefont setfont show}bd
/fcp{findfont dup length dict begin{1 index/FID ne{def}{pop pop}ifelse}forall}bd
/fmc{FontMatrix dup length array copy dup dup}bd/fmd{/FontMatrix exch def}bd
/Amul{4 -1 roll exch mul 1000 div}bd/ExtendFont{fmc 0 get Amul 0 exch put fmd}bd
/ScaleFont{dup fmc 0 get Amul 0 exch put dup dup 3 get Amul 3 exch put fmd}bd
/SlantFont{fmc 2 get dup 0 eq{pop 1}if Amul FontMatrix 0 get mul 2 exch put fmd}bd
%%EndResource
%%EndProlog
%%BeginSetup
%%EndSetup
%%Page: 1 1
0 0 0 setrgbcolor 0 5.66928 dtransform truncate idtransform setlinewidth pop
[] 0 setdash 1 setlinecap 1 setlinejoin 10 setmiterlimit
newpath 0 0 moveto
28.3464 0 lineto stroke
newpath 0 28.3464 moveto
7.82764 36.17404 20.51877 36.17404 28.3464 28.3464 curveto
36.17404 20.51877 36.17404 7.82764 28.3464 0 curveto stroke
showpage
%%EOF
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: -3 -3 38 38
%%HiResBoundingBox: -2.83464 -2.83464 37.05177 37.05177
%%Creator: MetaPost 1.9991
%%CreationDate: 2016.11.10:2029
%%Pages: 1
%%DocumentResources: procset mpost-minimal
%%DocumentSuppliedResources: procset mpost-minimal
%%EndComments
%%BeginProlog
%%BeginResource: procset mpost-minimal
/bd{bind def}bind def/fshow {exch findfont exch scalefont setfont show}bd
/fcp{findfont dup length dict begin{1 index/FID ne{def}{pop pop}ifelse}forall}bd
/fmc{FontMatrix dup length array copy dup dup}bd/fmd{/FontMatrix exch def}bd
/Amul{4 -1 roll exch mul 1000 div}bd/ExtendFont{fmc 0 get Amul 0 exch put fmd}bd
/ScaleFont{dup fmc 0 get Amul 0 exch put dup dup 3 get Amul 3 exch put fmd}bd
/SlantFont{fmc 2 get dup 0 eq{pop 1}if Amul FontMatrix 0 get mul 2 exch put fmd}bd
%%EndResource
%%EndProlog
%%BeginSetup
%%EndSetup
%%Page: 1 1
0 0 0 setrgbcolor 0 5.66928 dtransform truncate idtransform setlinewidth pop
[] 0 setdash 1 setlinecap 1 setlinejoin 10 setmiterlimit
newpath 0 0 moveto
28.3464 0 lineto
0 28.3464 lineto
7.82764 36.17404 20.51877 36.17404 28.3464 28.3464 curveto
36.17404 20.51877 36.17404 7.82764 28.3464 0 curveto stroke
showpage
%%EOF
This diff is collapsed.
This diff is collapsed.
prologues := 3; outputtemplate := "%c.eps";
%prologues := 3; % sortie EPS
%outputtemplate := "%c.eps"; % le nom se termine par .eps
% Unités
u:=10mm; % unité de base
xgraisse:=2mm; % graisse x
ygraisse:=2mm; % graisse y
visualisation:=2;
marge:=0u;
descendante:=2u;
chasse:=6u;
hauteurbasdecasse:=2u;
hauteurcapitale:=5u;
% function init pour générer une grille pour chaque glyphe avec argument "unicode" = nom glyphe + "nombre de colonnes" = cols
def init(suffix unicode)=
beginfig(unicode);
% if visualisation>=1:
% draw (-marge*u,descendante*u)--((marge+chasse)*u,descendante*u)--((marge+chasse)*u,hauteurcapitale+3u)--(-marge*u,hauteurcapitale+3u)-- cycle withcolor purple;
% fi
if visualisation>1:
pickup pencircle scaled 1;
% boucle grille horizontale
for i=0 upto chasse:
draw (i*u, (hauteurcapitale+1u))--(i*u, -2u) withcolor grey;
endfor
% boucle grille verticale
for i=0 upto 6:
draw (0, i*u)--(chasse*u,i*u) withcolor grey;
endfor
% boucle grille Xy
for i=0 upto 2:
draw (0, - i*u)--(chasse*u, - i*u) withcolor grey;
endfor
pickup pencircle scaled 3.5;
% ligne de hauteurcapitale
draw (0u,hauteurcapitale*u)--(chasse*u,hauteurcapitale*u) withcolor green;
% ligne de base
draw (0u,0u)--(chasse*u,0u) withcolor red;
% pencircle
penw:=.6u;
pickup pencircle xscaled (2*penw) yscaled penw rotated 30;
enddef;
% 115 = s
init(115);
x1:=0ux;
y1:=0uy;
x2:=1.2ux;
y2:=2.2uy;
x3:=1ux;
y3:=2uy;
x4:=2ux;
y4:=1uy;
x5:=1ux;
y5:=0uy;
x6:=0.5ux;
y6:=0.5uy;
x7:=1ux;
y7:=2.3uy;
draw z1 -- z2;
draw z2 .. z7 .. z3;
draw z3 -- z4;
draw z4 .. z5 .. z6;
endfig;
% 97 = a
init(97);
% pencircle
penw:=.5u;
pickup pencircle xscaled penw yscaled penw rotated 45;
z1=(2u,0.8X_Height)
z2=(0u, 0.5X_Height)
z3=(1u, 0u)
draw z1..z2..z3;
endfig;
beginfig(1);
x1=0u;
y1=0u;
x2=1u;
y2=0u;
pickup pencircle xscaled xgraisse yscaled ygraisse;
draw z1--z2;
endfig;
beginfig(2);
x1=0u;
y1=0u;
x2=1u;
y2=0u;
x3=0u;
y3=1u;
x4=1u;
y4=1u;
x5=1u;
y5=0u;
pickup pencircle xscaled xgraisse yscaled ygraisse;
draw z1--z2;
draw z3..z4..z5;
endfig;
beginfig(3);
x1=0u;
y1=0u;
x2=1u;
y2=0u;
x3=0u;
y3=1u;
x4=1u;
y4=1u;
x5=1u;
y5=0u;
pickup pencircle xscaled xgraisse yscaled ygraisse;
draw z1--z2--z3..z4..z5;
endfig;
end % nécessaire pour terminer proprement le fichier
for (( ; ; ));
do
mkdir -p svg eps
echo 'prologues := 3; outputtemplate := "%c.eps";' > eps/metahoguet.eps.mp
echo 'outputtemplate := "%c.svg";' > svg/metahoguet.svg.mp
curl http://osp.constantvzw.org:9999/p/metahoguet/export/txt | tee -a eps/metahoguet.eps.mp >> svg/metahoguet.svg.mp
cd svg
mpost -interaction=batchmode -s 'outputformat="svg"' metahoguet.svg.mp
cd ..
cd eps
mpost -interaction=batchmode -s 'outputformat="eps"' eps/metahoguet.eps.mp
cd ..
sleep 3
done
<?xml version="1.0"?>
<!-- Created by MetaPost 1.9991 on 2016.11.10:2029 -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="34.015686" height="5.669281" viewBox="0 0 34.015686 5.669281">
<!-- Original BoundingBox: -2.834641 -2.834641 31.181046 2.834641 -->
<path d="M2.000000 2.000000L30.346405 2.000000" style="stroke:rgb(0.000000%,0.000000%,0.000000%); stroke-width: 5.669281;stroke-linecap: round;stroke-linejoin: round;stroke-miterlimit: 10.000000;fill: none;"></path>
</svg>
This diff is collapsed.
<?xml version="1.0"?>
<!-- Created by MetaPost 1.9991 on 2016.11.10:2029 -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="39.886414" height="39.886414" viewBox="0 0 39.886414 39.886414">
<!-- Original BoundingBox: -2.834641 -2.834641 37.051773 37.051773 -->
<path d="M2.000000 37.000000L30.346405 37.000000" style="stroke:rgb(0.000000%,0.000000%,0.000000%); stroke-width: 5.669281;stroke-linecap: round;stroke-linejoin: round;stroke-miterlimit: 10.000000;fill: none;"></path>
<path d="M2.000000 8.653595C9.827637 0.825958,22.518768 0.825958,30.346405 8.653595C38.174042 16.481232,38.174042 29.172363,30.346405 37.000000" style="stroke:rgb(0.000000%,0.000000%,0.000000%); stroke-width: 5.669281;stroke-linecap: round;stroke-linejoin: round;stroke-miterlimit: 10.000000;fill: none;"></path>
</svg>
<?xml version="1.0"?>
<!-- Created by MetaPost 1.9991 on 2016.11.10:2029 -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="39.886414" height="39.886414" viewBox="0 0 39.886414 39.886414">
<!-- Original BoundingBox: -2.834641 -2.834641 37.051773 37.051773 -->
<path d="M2.000000 37.000000L30.346405 37.000000L2.000000 8.653595C9.827637 0.825958,22.518768 0.825958,30.346405 8.653595C38.174042 16.481232,38.174042 29.172363,30.346405 37.000000" style="stroke:rgb(0.000000%,0.000000%,0.000000%); stroke-width: 5.669281;stroke-linecap: round;stroke-linejoin: round;stroke-miterlimit: 10.000000;fill: none;"></path>
</svg>
This diff is collapsed.
outputtemplate := "%c.svg";
%prologues := 3; % sortie EPS
%outputtemplate := "%c.eps"; % le nom se termine par .eps
% Unités
u:=10mm; % unité de base
xgraisse:=2mm; % graisse x
ygraisse:=2mm; % graisse y
visualisation:=2;
marge:=0u;
descendante:=2u;
chasse:=6u;
hauteurbasdecasse:=2u;
hauteurcapitale:=5u;
% function init pour générer une grille pour chaque glyphe avec argument "unicode" = nom glyphe + "nombre de colonnes" = cols
def init(suffix unicode)=
beginfig(unicode);
% if visualisation>=1:
% draw (-marge*u,descendante*u)--((marge+chasse)*u,descendante*u)--((marge+chasse)*u,hauteurcapitale+3u)--(-marge*u,hauteurcapitale+3u)-- cycle withcolor purple;
% fi
if visualisation>1:
pickup pencircle scaled 1;
% boucle grille horizontale
for i=0 upto chasse:
draw (i*u, (hauteurcapitale+1u))--(i*u, -2u) withcolor grey;
endfor
% boucle grille verticale
for i=0 upto 6:
draw (0, i*u)--(chasse*u,i*u) withcolor grey;
endfor
% boucle grille Xy
for i=0 upto 2:
draw (0, - i*u)--(chasse*u, - i*u) withcolor grey;
endfor
pickup pencircle scaled 3.5;
% ligne de hauteurcapitale
draw (0u,hauteurcapitale*u)--(chasse*u,hauteurcapitale*u) withcolor green;
% ligne de base
draw (0u,0u)--(chasse*u,0u) withcolor red;
% pencircle
penw:=.6u;
pickup pencircle xscaled (2*penw) yscaled penw rotated 30;
enddef;
% 115 = s
init(115);
x1:=0ux;
y1:=0uy;
x2:=1.2ux;
y2:=2.2uy;
x3:=1ux;
y3:=2uy;
x4:=2ux;
y4:=1uy;
x5:=1ux;
y5:=0uy;
x6:=0.5ux;
y6:=0.5uy;
x7:=1ux;
y7:=2.3uy;
draw z1 -- z2;
draw z2 .. z7 .. z3;
draw z3 -- z4;
draw z4 .. z5 .. z6;
endfig;
% 97 = a
init(97);
% pencircle
penw:=.5u;
pickup pencircle xscaled penw yscaled penw rotated 45;
z1=(2u,0.8X_Height)
z2=(0u, 0.5X_Height)
z3=(1u, 0u)
draw z1..z2..z3;
endfig;
beginfig(1);
x1=0u;
y1=0u;
x2=1u;
y2=0u;
pickup pencircle xscaled xgraisse yscaled ygraisse;
draw z1--z2;
endfig;
beginfig(2);
x1=0u;
y1=0u;
x2=1u;
y2=0u;
x3=0u;
y3=1u;
x4=1u;
y4=1u;
x5=1u;
y5=0u;
pickup pencircle xscaled xgraisse yscaled ygraisse;
draw z1--z2;
draw z3..z4..z5;
endfig;
beginfig(3);
x1=0u;
y1=0u;
x2=1u;
y2=0u;
x3=0u;
y3=1u;
x4=1u;
y4=1u;
x5=1u;
y5=0u;
pickup pencircle xscaled xgraisse yscaled ygraisse;
draw z1--z2--z3..z4..z5;
endfig;
end % nécessaire pour terminer proprement le fichier
<html>
<head>
<meta charset="UTF-8">
<title>- </title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<style type="text/css" media="screen">
img {
height: 200px;;
width: auto;
overflow: visible;
}
footer{
bottom: 0px;
width: 100%;
position: fixed;
font-family: courier;
border-top: 1px solid blue;
color: blue;
text-transform: uppercase;
background: white;
}
.cadra{
width: auto;
height: 80px
padding: 0px;
float: left;
overflow: visible;
outline: red solid 1px;
}
.compare{
position: absolute;
opacity: 0.1;
}
.cadra span{
font-family: courier;
font-size: 7pt;
color: grey;
}
</style>
</head>
<body>
<footer>
<button onclick="Zoom('up')">+</button>
<button onclick="Zoom('down')">-</button>
<button onclick="Compare()">Compare</button>
<span id="type"></span>
</footer>
<script src="table.js"></script>
<script>
var elt = [];
function splitHash(){
var startImg = window.location.hash;
startImg = startImg.substring(2);
elt = startImg.split("-");
}
splitHash();
if(elt.length > 0){
for(i=0; i < elt.length; i++){
console.log(elt[i]);
$( "body" ).append('<img id="letter_'+i+'" title="cliquez pour imprimer" src="svg/'+elt[i]+'.svg" />');
}
}
function Zoom(valZ){
var imgH = $('img').height();
if(valZ == 'up'){
imgH = imgH + 50;
}else if (valZ == 'down'){
imgW = imgW - 50;
}
$('img').css("height", imgW);
}
function Compare(){
$('img').toggleClass('compare');
}
function testing () {
$("body").keydown( function( event ) {
if (event.key == "Backspace" ) {
$('img').last().remove();
}
})
$( "body" ).keypress(function(event) {
var savehash = window.location.hash;
savehash = savehash.substring(1);
$( "body" ).append('<img src="svg/'+event.keyCode+'.svg" />');
console.log(event.keyCode);
savehash += '-'+event.keyCode;
window.location.hash = savehash;
Zoom();
});
}
$("body").on("click", "img", function(){
var result = window.confirm('voulez-vous imprimer ce glyph ?');
if(result){
var path = $(this).attr('src').replace(/svg/g, 'eps');
$.post('http://exemple.org', { path : path });
}
});
setTimeout(function(){
window.location.reload(1);
}, 5000);
testing();
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment