<?xml version="1.0"?> <hershey> <letter id="1" count="9" left="-5" right="5" char="a"> <moveto x="0" y="-5"/> <lineto x="-4" y="4"/> <moveto x="0" y="-5"/> <lineto x="4" y="4"/> <moveto x="-2" y="1"/> <lineto x="2" y="1"/> </letter> <letter id="2" count="16" left="-5" right="5" char="b"> <moveto x="-3" y="-5"/> <lineto x="-3" y="4"/> <moveto x="-3" y="-5"/> <lineto x="1" y="-5"/> <lineto x="3" y="-4"/> <lineto x="3" y="-2"/> <lineto x="1" y="-1"/> <moveto x="-3" y="-1"/> <lineto x="1" y="-1"/> <lineto x="3" y="0"/> <lineto x="3" y="3"/>From there, I can generate some bindings
for various programming languages using XSLT, for example javascript:
{ "1":[{t:'M',x:0,y:-5},{t:'L',x:-4,y:4},{t:'M',x:0,y:-5},{t:'L',x:4,y:4},{t:'M',x:-2,y:1},{t:'L',x:2,y:1}], "2":[{t:'M',x:-3,y:-5},{t:'L',x:-3,y:4},{t:'M',x:-3,y:-5},{t:'L',x:1,y:-5},{t:'L',x:3,y:-4},{t:'L',x:3,y:-2},{t:'L',x:1,y:-1},{t:'M',x:-3,y:-1},{t:'L',x:1,y:-1},{t:'L',x:3,y:0},{t:'L',x:3,y:3},{t:'L',x:1,y:4},{t:'L',x:-3,y:4}], ...
In the Javascript example below, I'm generating some random rectangles where a sentence is written:
That's it,
Pierre
No comments:
Post a Comment