29.05.2014 Views

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

},<br />

},<br />

["pen"]={<br />

{<br />

["left_x"]=2.4548797607422,<br />

["left_y"]=1.4173278808594,<br />

["right_x"]=-0.70866394042969,<br />

["right_y"]=1.2274475097656,<br />

["x_coord"]=0,<br />

["y_coord"]=0,<br />

},<br />

["type"]="elliptical",<br />

},<br />

["type"]="outline",<br />

},<br />

},<br />

}<br />

This means that instead <strong>of</strong> parsing PostScript output, we now can operate on a proper<br />

datastructure and get code like the following:<br />

function convertgraphic(result)<br />

if result then<br />

local figures = result.fig<br />

if figures then<br />

for fig in ipairs(figures) do<br />

local llx, lly, urx, ury = unpack(fig:boundingbox())<br />

if urx > llx then<br />

startgraphic(llx, lly, urx, ury)<br />

for object in ipairs(fig:objects()) do<br />

if object.type == "..." then<br />

...<br />

flushgraphic(...)<br />

...<br />

else<br />

...<br />

end<br />

end<br />

finishgraphic()<br />

end<br />

end<br />

end<br />

184 <strong>The</strong> MetaPost Library

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!