diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-13 09:49:11 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-13 09:49:11 +0000 |
commit | e44a7e37b6c7b5961adaffc62b9042b8d442938e (patch) | |
tree | 95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dojox/gfx/tests/test_textpath.html | |
parent | a62b9742ee5e28bcec6872d88f50f25b820914f6 (diff) | |
download | semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2 |
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/gfx/tests/test_textpath.html')
-rw-r--r-- | includes/js/dojox/gfx/tests/test_textpath.html | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/includes/js/dojox/gfx/tests/test_textpath.html b/includes/js/dojox/gfx/tests/test_textpath.html new file mode 100644 index 0000000..201b0b5 --- /dev/null +++ b/includes/js/dojox/gfx/tests/test_textpath.html @@ -0,0 +1,76 @@ +<html> +<head> +<title>Testing textpath</title> +<style type="text/css"> + @import "../../../dojo/resources/dojo.css"; + @import "../../../dijit/tests/css/dijitTests.css"; +</style> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script> +<!-- +<script type="text/javascript" src="../common.js"></script> +<script type="text/javascript" src="../shape.js"></script> +<script type="text/javascript" src="../path.js"></script> +--> +<!--<script type="text/javascript" src="../vml.js"></script>--> +<!--<script type="text/javascript" src="../svg.js"></script>--> +<script type="text/javascript"> +dojo.require("dojox.gfx"); + +var CPD = 30; + +var surface = null; + +var makeText = function(surface, text, font, fill, stroke){ + var t = surface.createText(text); + if(font) t.setFont(font); + if(fill) t.setFill(fill); + if(stroke) t.setStroke(stroke); + placeAnchor(surface, text.x, text.y); + return t; +}; + +makeShapes = function(){ + surface = dojox.gfx.createSurface("test", 500, 500); + var p = surface.createPath({}) + .setStroke("green") + .moveTo(0, 100) + .setAbsoluteMode(false) + .curveTo(CPD, 0, 100 - CPD, 300, 100, 300) + .curveTo(CPD, 0, 100 - CPD, -300, 100, -300) + .curveTo(CPD, 0, 100 - CPD, 300, 100, 300) + .curveTo(CPD, 0, 100 - CPD, -300, 100, -300) + .curveTo(CPD, 0, 100 - CPD, 300, 100, 300) + ; + console.debug(p); + var t = surface.createTextPath({ + text: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent erat. " + + "In malesuada ultricies velit. Vestibulum tempor odio vitae diam. " + + "Morbi arcu lectus, laoreet eget, nonummy at, elementum a, quam." + , align: "middle" + //, rotated: true + }) + //.setShape(p.shape) + .moveTo(0, 100) + .setAbsoluteMode(false) + .curveTo(CPD, 0, 100 - CPD, 300, 100, 300) + .curveTo(CPD, 0, 100 - CPD, -300, 100, -300) + .curveTo(CPD, 0, 100 - CPD, 300, 100, 300) + .curveTo(CPD, 0, 100 - CPD, -300, 100, -300) + .curveTo(CPD, 0, 100 - CPD, 300, 100, 300) + .setFont({family: "times", size: "12pt"}) + .setFill("blue") + ; + console.debug(t); +}; + +dojo.addOnLoad(makeShapes); + +</script> +</head> +<body> + <h1>dojox.gfx Text on a Path test</h1> +<div id="test" style="width: 500px; height: 500px;"></div> +<p>That's all Folks!</p> +</body> +</html> |