Tecnologías XML / SVG / Utilizar elementos de texto / Soluciones

(Extracto de «Das Einsteigerseminar SVG — Webgrafiken mit XML» de Helma Spona)

  1. Para especificar la codificación, utilice en el primer elemento del archivo SVG el atributo encoding correspondiente.

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">
<svg>
  ...
</svg>

  1. Para insertar texto, utilice de nuevo la etiqueta <text> correspondiente.

<text x="0" y="20">Texte können auch an Pfaden ausgerichtet werden!</text>

  1. Utilice la siguiente instrucción para crear el trazado:

  2. <path d="M0 0 l+300 +300"/>
  3. Asigne un nombre al trazado y alinee el texto con él mediante la etiqueta <textPath> y su atributo xlink:href:

<text x="0" y="20">
  <textPath xlink:href="#linie">Texte können auch an Pfaden ausgerichtet werden!</textPath>
</text>
<path id="linie" d="M0 0 l+300 +300" />

  1. Para espaciar el texto, añada a la etiqueta <text> el atributo style como se muestra: <text x="0" y="20" style="letter-spacing:4">.

   

<< atrás

siguiente >>

 

 

 

volver arriba