| 1 | <!DOCTYPE HTML> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <script src="../../../dojo/dojo.js" data-dojo-config="isDebug: true,parseOnLoad: true, async:1, gfxRenderer:'svg'"></script> |
| 5 | <script> |
| 6 | require([ |
| 7 | "dojo/_base/array", |
| 8 | "dojox/gfx", |
| 9 | "dojox/gfx/matrix", |
| 10 | "dojo/ready", |
| 11 | "dojox/gfx/svgext"], |
| 12 | function(array, gfx, matrix, ready){ |
| 13 | |
| 14 | var surface = gfx.createSurface("slideTarget", 700, 500), g, parent = surface; |
| 15 | array.forEach(["auto","optimizeSpeed","crispEdges","geometricPrecision"], function(opt,idx){ |
| 16 | g = parent.createGroup().setTransform(matrix.translate(0, 20*idx)); |
| 17 | g.createLine({ |
| 18 | x1 : 10, |
| 19 | y1 : 10, |
| 20 | x2 : 490, |
| 21 | y2 : 100 |
| 22 | }).setStroke("blue").addRenderingOption("shape-rendering", opt); |
| 23 | g.createText({ |
| 24 | x : 490, |
| 25 | y : 100, |
| 26 | text :opt |
| 27 | }).setFill("black"); |
| 28 | }); |
| 29 | parent = surface.createGroup().setTransform(matrix.translate(0, 80)); |
| 30 | array.forEach(["auto","optimizeSpeed","crispEdges","geometricPrecision"], function(opt,idx){ |
| 31 | g = parent.createGroup().setTransform(matrix.translate(0, 20*idx)); |
| 32 | g.createLine({ |
| 33 | x1 : 10, |
| 34 | y1 : 100, |
| 35 | x2 : 490, |
| 36 | y2 : 100 |
| 37 | }).setStroke("blue").addRenderingOption("shape-rendering", opt); |
| 38 | g.createText({ |
| 39 | x : 490, |
| 40 | y : 100, |
| 41 | text :opt |
| 42 | }).setFill("black"); |
| 43 | }); |
| 44 | parent = surface.createGroup().setTransform(matrix.translate(0, 160)); |
| 45 | array.forEach(["auto","optimizeSpeed","optimizeLegibility","geometricPrecision"], function(opt,idx){ |
| 46 | g = parent.createGroup().setTransform(matrix.translate(0, 20*idx)); |
| 47 | g.createText({ |
| 48 | x : 50, |
| 49 | y : 100, |
| 50 | text : "LYoWAT ff fi fl ffl ("+ opt +")" |
| 51 | }).setFill("black").setFont({size:"23px", family:"Calibri, Constantia"}).addRenderingOption("text-rendering" , opt); |
| 52 | }); |
| 53 | }); |
| 54 | |
| 55 | </script> |
| 56 | </head> |
| 57 | <body> |
| 58 | This test demonstrates the various SVG rendering options in action. This test only works on browsers supporting SVG. |
| 59 | <div id="slideTarget" ></div> |
| 60 | </body> |
| 61 | </html> |