source: other-projects/nz-flag-design/trunk/design-2d/Original editor.method.ac/editor/css/font-files/test.html@ 29468

Last change on this file since 29468 was 29468, checked in by sjs49, 9 years ago

Initial commit for editor.method.ac for flag design

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1<!DOCTYPE HTML>
2<html lang="en-En">
3<head>
4 <meta charset="UTF-8">
5 <title>SVG @font-face Test</title>
6</head>
7<body>
8 <h2>@font-face in SVG</h2>
9
10 <p style="width: 500px"><strong>Problem:</strong> I'm trying trying to place an images in svg format with custom fonts. It works in <code>svg</code> but not in <code>img</code>. If you open the image in a new tab you will see it rendered with the proper font. The font is served from this same website in this directory.</p>
11
12 <a href="test_ff.svg">Link to the test.svg</a>
13
14 <table>
15 <tr><td>
16 <svg width="500" height="200" version="1.1" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 200">
17 <defs>
18 <style type="text/css">
19 @font-face {
20 font-family: 'Arvo';
21 font-style: normal;
22 font-weight: normal;
23 src: url(arvo-regular-webfont.woff) format('woff');
24 }
25 </style>
26 </defs>
27 <rect x="0" y="0" height="100" width="500" fill="#eee" />
28 <text x="20" y="50" font-family="Arvo" font-weight="normal" font-size="32">Text using CSS @font-face</text>
29 </svg>
30 </td>
31 <td>
32 <pre>
33 &lt;svg width=&quot;500&quot; height=&quot;200&quot; version=&quot;1.1&quot; xmlns = &#39;http://www.w3.org/2000/svg&#39; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; viewBox=&quot;0 0 500 200&quot;&gt;
34 &lt;defs&gt;
35 &lt;style type=&quot;text/css&quot;&gt;
36 @font-face {
37 font-family: &#39;Arvo&#39;;
38 font-style: normal;
39 font-weight: normal;
40 src: url(arvo-regular-webfont.woff) format(&#39;woff&#39;);
41 }
42 &lt;/style&gt;
43 &lt;/defs&gt;
44 &lt;rect x=&quot;0&quot; y=&quot;0&quot; height=&quot;100&quot; width=&quot;500&quot; fill=&quot;#eee&quot; /&gt;
45 &lt;text x=&quot;20&quot; y=&quot;50&quot; font-family=&quot;Arvo&quot; font-weight=&quot;normal&quot; font-size=&quot;32&quot;&gt;Text using CSS @font-face&lt;/text&gt;
46 &lt;/svg&gt;
47 </pre>
48 </td>
49 </tr>
50 <tr>
51 <td><img src="test_ff.svg" width="500" height="200" /></td>
52 <td style="verical-align: top;">
53 <pre>
54 &lt;img src="test_ff.svg" width="500" height="200" /&gt;
55 </pre>
56 </td>
57 </tr>
58 </table>
59
60
61</body>
62</html>
Note: See TracBrowser for help on using the repository browser.