text-gradient-04.svg 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <!--
  2. Any copyright is dedicated to the Public Domain.
  3. http://creativecommons.org/publicdomain/zero/1.0/
  4. -->
  5. <svg xmlns="http://www.w3.org/2000/svg">
  6. <title>Test for gradients being positioned correctly within filters</title>
  7. <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=797708 -->
  8. <style>
  9. @font-face {
  10. src: url(../fonts/Ahem.ttf);
  11. font-family: Ahem;
  12. }
  13. </style>
  14. <linearGradient id="g" gradientUnits="userSpaceOnUse" x1="100" y1="0" x2="300" y2="0">
  15. <stop offset="0" stop-color="red"/>
  16. <stop offset="0.5" stop-color="red"/>
  17. <stop offset="0.5" stop-color="blue"/>
  18. <stop offset="1" stop-color="blue"/>
  19. </linearGradient>
  20. <filter id="f">
  21. <feMerge>
  22. <feMergeNode in="SourceGraphic"/>
  23. </feMerge>
  24. </filter>
  25. <clipPath id="c">
  26. <path d="M 130,70 h 40 v 40 h -40 z
  27. M 230,70 h 40 v 40 h -40 z"/>
  28. </clipPath>
  29. <g style="font: 64px Ahem; fill: url(#g); text-anchor: middle; filter: url(#f); clip-path: url(#c)">
  30. <text x="150" y="100">a</text>
  31. <text x="250" y="100">a</text>
  32. </g>
  33. </svg>