?> <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> </head> <body> <div class="row"> <div class="col-xs-12"> <h1>EasySVG demo</h1> <h2>Text example</h2> <?php $svg = new EasySVG(); $svg->setFontSVG("paris-bold-webfont.svg"); //$svg->setFontSVG("swiss-924-bt-webfont.svg"); $svg->setFontSize(100); $svg->setFontColor('#000000'); $def = $svg->addText("Hello"); $svg->addAttribute("width", "800px"); $svg->addAttribute("height", "100px"); $def = 'Hello'; //$rotated_def = $svg->defRotate($def, 40); echo $svg->asXML(); ?> <pre> $svg = new EasySVG(); $svg->setFontSVG("paris-bold-webfont.svg"); $svg->setFontSize(100);
<?xml version="1.0"?> <svg width="800px" height="100px"> <path fill="#000000" d="M5.2734375,14.74609375l0-0.09765625q0-0.244140625,0.09765625-0.537109375l-0.09765625-6.103515625l2.587890625,0.244140625l0.146484375,6.103515625q0,0.146484375-0.0732421875,0.341796875t-0.0732421875,0.439453125q0,0.9765625,0.0732421875,1.806640625t0.1708984375,1.416015625l0-0.09765625q0.146484375,0.390625,0.2197265625,1.1962890625t0.0732421875,1.4404296875q0.146484375,1.3671875,0.1953125,3.1005859375t0.048828125,3.0029296875l0,1.7333984375t-0.146484375,2.0263671875q-0.146484375,1.123046875-0.1953125,2.6123046875t-0.048828125,2.5146484375q0,1.611328125,0.0732421875,3.1005859375t0.1708984375,3.0029296875l0,1.3671875q0,0.244140625,0.0732421875,0.3173828125t0.0732421875,0.4638671875l7.6171875,0q0.48828125,0,0.8544921875-0.0732421875t0.9033203125-0.0732421875l1.7822265625,0t1.6845703125-0.09765625q0.48828125,0,0.927734375-0.0732421875t1.07421875-0.2197265625q0.244140625,0,0.5615234375-0.048828125t0.5615234375-0.048828125q0.634765625-0.146484375,1.318359375-0.1953125t1.318359375-0.048828125l0.87890625,0q0.244140625,0,0.48828125-0.0732421875t0.48828125-0.0732421875q0.48828125-0.146484375,1.2451171875-0.146484375t1.2939453125,0.048828125l0-1.123046875q0-2.392578125-0.0732421875-4.8828125t-0.1708984375-5.029296875q0-0.634765625-0.0732421875-1.2451171875t-0.0732421875-1.2451171875l0-2.34375q-0.146484375-2.63671875-0.1953125-6.005859375t-0.048828125-5.76171875l0-0.634765625q0-0.244140625-0.0732421875-0.68359375t-0.0732421875-0.927734375q-0.146484375-0.9765625-0.1220703125-2.5634765625t0.0244140625-2.1728515625l2.63671875,0l0,2.05078125t0.09765625,2.294921875q0,0.48828125,0.0732421875,0.927734375t0.0732421875,0.830078125l0,0.87890625q0,2.880859375,0.048828125,5.810546875t0.1953125,5.95703125l0,2.24609375q0,0.634765625,0.048828125,1.171875t0.048828125,1.171875q0.146484375,2.24609375,0.1953125,5.2001953125t0.048828125,4.9560546875l0,2.83203125q0,1.7578125-0.048828125,3.3203125t-0.1953125,3.076171875q-0.146484375,2.1484375-0.1953125,4.833984375t-0.048828125,4.78515625q0,1.7578125,0.0732421875,3.515625t0.1708984375,3.61328125q0.146484375,0.9765625,0.1953125,2.1728515625t0.048828125,2.0751953125q0,0.244140625-0.048828125,0.48828125t-0.048828125,0.537109375l0,3.466796875l0,2.5146484375t0.09765625,2.7587890625q0.146484375,0.9765625,0.2197265625,2.099609375t0.0732421875,2.1484375l0,12.59765625l-2.63671875,0l0-12.59765625q0-1.123046875-0.0732421875-2.197265625t-0.1708984375-2.44140625q-0.146484375-0.9765625-0.146484375-2.4169921875l0-2.4658203125l0-3.466796875q0-0.244140625,0.0732421875-0.5126953125t0.0732421875-0.5126953125q0-0.9765625-0.0732421875-2.099609375t-0.1708984375-2.1484375q-0.146484375-1.7578125-0.2197265625-3.564453125t-0.0732421875-3.564453125q0-2.490234375,0.0732421875-4.931640625t0.2197265625-4.931640625l0-0.48828125q0.146484375-1.3671875,0.1953125-2.3681640625t0.048828125-2.4169921875l-0.927734375,0t-1.07421875,0.146484375q-0.244140625,0-0.634765625,0.0732421875t-0.634765625,0.0732421875l-0.87890625,0l-5.76171875,0.732421875l-3.564453125,0t-3.41796875,0.09765625l-6.103515625,0l0,0.634765625q0,0.244140625,0.048828125,0.5615234375t0.048828125,0.5615234375l0,28.515625q0,0.48828125,0.0732421875,1.0009765625t0.0732421875,1.0986328125l0,1.2451171875t-0.146484375,1.2939453125l0,4.4921875q-0.146484375,0.634765625-0.1220703125,1.3671875t0.0244140625,1.513671875l0,1.123046875q0.146484375,0.390625,0.1220703125,1.07421875t-0.0244140625,1.171875l0,0.732421875q-0.146484375,0.732421875-0.1220703125,2.44140625t0.0244140625,2.685546875l-2.63671875,0l0-2.5634765625t0.09765625-2.5634765625l0-1.611328125q0-0.146484375-0.048828125-0.1953125t-0.048828125-0.29296875l0-1.26953125q0-0.146484375-0.0732421875-0.2685546875t-0.0732421875-0.4638671875q0-0.87890625,0.0732421875-1.8310546875t0.1708984375-1.5380859375l0-4.541015625q0.146484375-0.634765625,0.146484375-1.0498046875l0-0.9521484375q0-0.634765625-0.0732421875-1.123046875t-0.0732421875-0.9765625l0-28.369140625q0-0.244140625-0.048828125-0.5615234375t-0.048828125-0.7080078125l0-1.3671875l-0.390625-10.107421875q0-1.3671875,0.0732421875-2.8076171875t0.1708984375-2.8076171875q0.146484375-0.87890625,0.146484375-1.6357421875l0-1.6357421875q0-1.513671875-0.0732421875-3.0029296875t-0.1708984375-3.0029296875q0-0.390625-0.0732421875-0.9521484375t-0.1708984375-1.1474609375q-0.146484375-0.732421875-0.1953125-1.7578125t-0.048828125-2.392578125z M44.189453125,99.853515625l0.146484375-1.611328125q0.244140625-0.634765625,0.244140625-1.07421875l0-1.025390625l0-2.63671875l0-2.5146484375t0.146484375-2.7587890625q0-0.244140625,0.048828125-0.6103515625t0.048828125-0.6103515625q0.390625-3.857421875,0.439453125-7.861328125t0.048828125-7.91015625l0-4.00390625l0-3.662109375t0.146484375-3.466796875l0-3.369140625q0-0.9765625,0.0732421875-1.9287109375t0.0732421875-1.5380859375q0-0.390625-0.0732421875-0.7568359375t-0.0732421875-0.7568359375l0-4.150390625l-0.244140625-2.34375l-0.244140625-2.63671875q-0.244140625-1.3671875-0.3662109375-3.0029296875t-0.1220703125-3.1005859375l0-1.025390625q0-0.146484375,0.048828125-0.1953125t0.048828125-0.1953125l0-4.248046875l0-1.9775390625t0.146484375-2.1240234375l0.341796875-4.638671875q0-0.390625,0.0732421875-0.9521484375t0.0732421875-1.0498046875q0.146484375-1.513671875,0.439453125-2.001953125t0.537109375-0.634765625l-0.732421875,0.29296875l0-4.2724609375t0.146484375-4.2724609375q0-0.244140625,0.048828125-0.68359375t0.048828125-0.68359375l3.369140625,0q0.48828125,0,0.87890625,0.0732421875t0.87890625,0.0732421875l5.615234375,0l5.2001953125,0t5.4443359375,0.244140625l6.982421875,0.390625q0.48828125,0.146484375,1.7578125,0.09765625l0.732421875,0q0.244140625,0,1.26953125-0.244140625l1.025390625-0.244140625l0,3.271484375q-0.390625,0.146484375-0.78125,0.09765625l-1.3671875,0l-0.48828125,0q-0.146484375,0-0.1953125-0.048828125t-0.1953125-0.048828125l-1.318359375,0t-1.07421875-0.146484375l-0.9765625,0q-0.244140625,0-0.5615234375-0.0732421875t-0.5615234375-0.0732421875q-0.9765625,0-2.24609375-0.048828125t-2.1484375-0.1953125q-2.490234375-0.244140625-5.37109375-0.29296875t-5.126953125-0.048828125l-5.615234375,0q-0.48828125,0-0.8544921875-0.0732421875t-0.9033203125-0.0732421875l-1.123046875,0q-0.146484375,1.513671875-0.146484375,3.173828125q0.048828125,0.29296875,0.048828125,0.5859375l0,3.759765625q0,0.87890625-0.0732421875,1.806640625t-0.1708984375,2.294921875l-0.390625,4.736328125l0,2.001953125l0,2.5146484375t-0.0732421875,2.3193359375t-0.0732421875,1.416015625l0,1.416015625l0,3.7841796875t0.244140625,3.8330078125l0.390625,0q0.634765625,0,1.025390625-0.146484375l1.3671875-0.244140625q0.87890625-0.244140625,2.001953125-0.3173828125t2.099609375-0.0732421875l6.884765625-0.48828125l2.24609375,0l2.05078125,0t2.099609375,0.244140625l-0.146484375,0q0.732421875,0.146484375,1.85546875,0.146484375l2.294921875,0l2.587890625,0l-0.09765625,2.734375l-3.369140625,0q-0.87890625,0-1.8310546875,0.0732421875t-1.8310546875-0.1708984375q-0.9765625-0.244140625-1.85546875-0.2685546875t-1.7578125-0.0244140625l-2.24609375,0l-6.884765625,0.537109375q-1.7578125,0-4.00390625,0.341796875q-0.244140625,0-0.4150390625,0.0732421875t-0.4638671875,0.0732421875q-0.390625,0.146484375-0.87890625,0.1220703125t-0.732421875-0.0244140625q0,0.146484375,0.0732421875,0.2685546875t0.0732421875,0.2685546875l0,4.4921875q0,0.390625,0.048828125,0.7568359375t0.048828125,0.7568359375l0,3.369140625q0,0.87890625-0.048828125,1.7333984375t-0.048828125,1.8798828125q-0.146484375,1.611328125-0.146484375,3.41796875l0,3.564453125l0,4.00390625q0,3.857421875-0.048828125,7.861328125t-0.341796875,8.0078125q-0.146484375,1.3671875-0.1953125,3.1982421875t-0.048828125,3.1982421875l0,3.61328125q0.244140625-0.146484375,0.5126953125-0.2685546875t0.6103515625-0.1220703125l9.130859375,0q0.244140625,0,0.5126953125,0.0732421875t0.5126953125,0.0732421875l2.734375,0q4.39453125,0,9.130859375-0.390625q0.244140625,0,0.48828125-0.048828125t0.48828125-0.048828125l4.00390625,0q0.48828125,0,1.123046875-0.0732421875t1.025390625-0.0732421875l0,2.63671875l-1.6845703125,0t-1.3427734375,0.146484375q-0.244140625,0-0.68359375,0.048828125t-0.68359375,0.048828125l-0.9765625,0q-2.490234375,0.244140625-5.4443359375,0.3662109375t-5.4443359375,0.1220703125l-2.880859375,0q-0.244140625,0-0.439453125-0.048828125t-0.439453125-0.048828125l-9.130859375,0q-0.634765625,0-0.9765625,0.09765625q-0.9765625,0.244140625-1.513671875,0.244140625l-1.513671875,0z M85.83984375,57.51953125l0-17.529296875l0.244140625-8.0078125l0.341796875-8.10546875q0.244140625-2.1484375,0.390625-4.1259765625t0.146484375-3.8818359375q0-1.123046875-0.0732421875-2.3681640625t-0.5615234375-3.1494140625l2.63671875-0.09765625q0.48828125,1.85546875,0.537109375,3.173828125t0.048828125,2.44140625q0,1.7578125-0.1220703125,4.00390625t-0.3662109375,4.00390625q0,0.48828125-0.048828125,1.2939453125t-0.048828125,1.4404296875q-0.146484375,0.732421875-0.146484375,1.3671875l0,1.123046875q-0.244140625,2.734375-0.3173828125,5.4931640625t-0.1708984375,5.3955078125q-0.146484375,1.513671875-0.146484375,2.9541015625l0,2.9541015625l0,8.59375q0,0.732421875,0.0732421875,1.4892578125t0.0732421875,1.5380859375q0,4.4921875,0.1953125,9.1064453125t0.439453125,9.1064453125q0.244140625,3.125,0.4150390625,6.5185546875t0.1708984375,6.5185546875q0,0.390625-0.048828125,0.7568359375t-0.048828125,0.7080078125l0,4.8828125q0,0.390625-0.0732421875,0.439453125t0.0732421875,0.439453125q0.146484375,0,0.3173828125-0.048828125t0.5615234375-0.048828125q0.146484375,0,0.1220703125-0.0732421875t0.1220703125-0.0732421875q0.9765625-0.244140625,2.1728515625-0.244140625l1.9287109375,0l9.375,0l1.9287109375,0t1.9775390625-0.146484375l0.6103515625,0t0.6103515625-0.09765625q0.244140625-0.146484375,0.87890625-0.146484375l0.87890625,0l0.634765625,0q0.244140625,0,0.5615234375-0.048828125t0.7080078125-0.048828125q0.244140625,0,0.3662109375,0.048828125t0.3662109375,0.048828125l3.125,0l-0.244140625,2.63671875l-3.02734375,0q-0.244140625,0-0.3662109375-0.0732421875t-0.3662109375-0.0732421875q-0.244140625,0.146484375-0.8056640625,0.146484375l-0.8056640625,0t-0.3662109375,0.048828125t-0.4150390625,0.048828125l-0.48828125,0q-0.390625,0.146484375-1.0009765625,0.146484375l-0.8544921875,0q-0.87890625,0.146484375-1.953125,0.146484375l-1.806640625,0l-9.521484375,0l-1.6845703125,0t-1.7822265625,0.244140625q-0.146484375,0-0.2685546875,0.048828125t-0.5126953125,0.048828125q-0.9765625,0.244140625-2.34375,0.244140625l-1.123046875-0.09765625q-0.146484375-0.87890625-0.146484375-2.0751953125l0-2.1728515625l0-4.150390625q0-0.390625,0.0732421875-0.7568359375t0.0732421875-0.7080078125q0-3.271484375-0.1953125-6.4697265625t-0.439453125-6.5673828125q-0.244140625-4.4921875-0.3662109375-9.1064453125t-0.1220703125-9.1064453125z M125.5859375,57.51953125l0-17.529296875l0.244140625-8.0078125l0.341796875-8.10546875q0.244140625-2.1484375,0.390625-4.1259765625t0.146484375-3.8818359375q0-1.123046875-0.0732421875-2.3681640625t-0.5615234375-3.1494140625l2.63671875-0.09765625q0.48828125,1.85546875,0.537109375,3.173828125t0.048828125,2.44140625q0,1.7578125-0.1220703125,4.00390625t-0.3662109375,4.00390625q0,0.48828125-0.048828125,1.2939453125t-0.048828125,1.4404296875q-0.146484375,0.732421875-0.146484375,1.3671875l0,1.123046875q-0.244140625,2.734375-0.3173828125,5.4931640625t-0.1708984375,5.3955078125q-0.146484375,1.513671875-0.146484375,2.9541015625l0,2.9541015625l0,8.59375q0,0.732421875,0.0732421875,1.4892578125t0.0732421875,1.5380859375q0,4.4921875,0.1953125,9.1064453125t0.439453125,9.1064453125q0.244140625,3.125,0.4150390625,6.5185546875t0.1708984375,6.5185546875q0,0.390625-0.048828125,0.7568359375t-0.048828125,0.7080078125l0,4.8828125q0,0.390625-0.0732421875,0.439453125t0.0732421875,0.439453125q0.146484375,0,0.3173828125-0.048828125t0.5615234375-0.048828125q0.146484375,0,0.1220703125-0.0732421875t0.1220703125-0.0732421875q0.9765625-0.244140625,2.1728515625-0.244140625l1.9287109375,0l9.375,0l1.9287109375,0t1.9775390625-0.146484375l0.6103515625,0t0.6103515625-0.09765625q0.244140625-0.146484375,0.87890625-0.146484375l0.87890625,0l0.634765625,0q0.244140625,0,0.5615234375-0.048828125t0.7080078125-0.048828125q0.244140625,0,0.3662109375,0.048828125t0.3662109375,0.048828125l3.125,0l-0.244140625,2.63671875l-3.02734375,0q-0.244140625,0-0.3662109375-0.0732421875t-0.3662109375-0.0732421875q-0.244140625,0.146484375-0.8056640625,0.146484375l-0.8056640625,0t-0.3662109375,0.048828125t-0.4150390625,0.048828125l-0.48828125,0q-0.390625,0.146484375-1.0009765625,0.146484375l-0.8544921875,0q-0.87890625,0.146484375-1.953125,0.146484375l-1.806640625,0l-9.521484375,0l-1.6845703125,0t-1.7822265625,0.244140625q-0.146484375,0-0.2685546875,0.048828125t-0.5126953125,0.048828125q-0.9765625,0.244140625-2.34375,0.244140625l-1.123046875-0.09765625q-0.146484375-0.87890625-0.146484375-2.0751953125l0-2.1728515625l0-4.150390625q0-0.390625,0.0732421875-0.7568359375t0.0732421875-0.7080078125q0-3.271484375-0.1953125-6.4697265625t-0.439453125-6.5673828125q-0.244140625-4.4921875-0.3662109375-9.1064453125t-0.1220703125-9.1064453125z M164.94140625,58.10546875q0-3.759765625,0.390625-7.373046875q0.634765625-4.39453125,1.9287109375-9.3017578125t4.1748046875-9.5458984375q0.244140625-0.244140625,0.3662109375-0.634765625t0.3662109375-0.634765625q1.7578125-2.63671875,3.5888671875-5.322265625t3.5400390625-4.296875l2.392578125-2.099609375q1.7578125-1.3671875,4.0771484375-3.3935546875t4.1748046875-3.0029296875q2.001953125-0.9765625,4.6142578125-1.9775390625t5.2490234375-1.3916015625q0.390625,0,1.025390625-0.146484375q0.87890625-0.146484375,1.8798828125-0.1953125t1.9775390625-0.048828125q2.392578125,0,4.6875,0.634765625t3.564453125,0.9765625q2.734375,0.9765625,5.2490234375,1.9287109375t5.3955078125,3.1982421875q3.369140625,2.490234375,5.615234375,5.2001953125t3.61328125,6.7138671875q1.26953125,3.61328125,1.953125,7.2998046875t1.318359375,7.4462890625q0.244140625,2.001953125,0.4150390625,4.052734375t0.1708984375,4.443359375q0,8.251953125-2.24609375,16.30859375t-6.982421875,14.55078125q-2.490234375,3.271484375-5.7373046875,6.201171875t-7.12890625,5.2490234375t-8.0810546875,3.6865234375t-8.30078125,1.3671875q-0.732421875,0-1.123046875-0.146484375q-2.978515625-0.146484375-5.17578125-1.318359375t-4.345703125-2.5390625q-0.634765625,0-0.5859375-0.634765625q-0.634765625-0.634765625-1.7578125-1.2451171875t-2.392578125-1.3427734375l0,0.09765625l-1.611328125-0.9765625q-1.3671875-0.87890625-2.880859375-1.8310546875t-3.125-2.5634765625q-5.517578125-5.126953125-7.8857421875-12.5t-2.3681640625-14.892578125z M167.431640625,58.10546875q0,7.12890625,2.197265625,14.013671875t7.32421875,11.5234375q1.7578125,1.7578125,3.369140625,2.734375t3.22265625,1.85546875l4.638671875,3.02734375l-0.48828125-0.244140625q2.24609375,1.7578125,4.736328125,2.880859375t5.37109375,1.3671875l0.390625,0.09765625q3.857421875,0,7.8125-1.2451171875t7.568359375-3.369140625t6.689453125-4.8828125t5.17578125-5.7373046875q4.248046875-5.859375,6.4453125-13.7451171875t2.197265625-15.7470703125q0-2.001953125-0.1953125-4.00390625t-0.439453125-3.857421875q-0.634765625-3.759765625-1.318359375-7.3974609375t-1.806640625-7.2509765625q-1.26953125-3.61328125-3.271484375-6.1279296875t-4.8828125-4.5166015625q-2.1484375-1.611328125-4.6142578125-2.6123046875t-5.3466796875-1.8798828125q-1.123046875-0.390625-3.3935546875-1.0009765625t-4.1259765625-0.6103515625q-0.390625,0-1.123046875,0.0732421875t-1.3671875,0.1708984375q-0.634765625,0.146484375-1.1962890625,0.146484375l-0.8056640625,0q-1.85546875,0.390625-4.443359375,1.3916015625t-4.443359375,1.9775390625q-2.1484375,0.9765625-3.759765625,2.294921875t-3.22265625,2.83203125l-1.025390625,0.87890625l-2.099609375,1.85546875q-2.1484375,2.001953125-3.6376953125,4.052734375t-2.6123046875,3.955078125l-1.7578125,2.490234375q-2.1484375,3.61328125-3.3935546875,8.30078125t-1.8798828125,9.08203125l0-0.146484375q-0.244140625,1.7578125-0.3662109375,3.6376953125t-0.1220703125,3.7353515625z"/> </svg> <?php */ //exit; require 'easysvg/src/EasySVG.php'; ini_set("display_errors", "Off"); $text = $_REQUEST['text']; $font = $_REQUEST['font_type']; $svg = new EasySVG(); /*switch ($font) { case 'Swiss': $svg->setFontSVG("fonts/swiss-924-bt-webfont.svg"); break; default: $svg->setFontSVG("fonts/paris-bold-webfont.svg"); break; }*/ //$svg->setFontSVG("fonts/GoodDog-webfont.svg"); //$svg->setFontSVG("fonts/swiss-924-bt-webfont.svg"); $svg->setFontSVG("fonts/paris-bold-webfont.svg"); $text_length = strlen($text); $svg->setFontSize(100); $svg->setFontColor('#000000');
?> <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> </head> <body> <div class="row"> <div class="col-xs-12"> <h1>EasySVG demo</h1> <?php $text = "Simple text display\netc."; $svg = new EasySVG(); $svg->setFontSVG("paris-bold-webfont.svg"); $svg->setFontSize(100); $svg->setFontColor('#000000'); $svg->setLineHeight(1.2); $svg->addText($text); // set width/height according to text list($textWidth, $textHeight) = $svg->textDimensions($text); $svg->addAttribute("width", $textWidth . "px"); $svg->addAttribute("height", $textHeight . "px"); echo $svg->asXML(); ?> <br/><br/><br/> <pre> $text = "Simple text display\netc.";