OLD | NEW |
1 <!-- BEGIN AUTHORED CONTENT --> | 1 <!-- BEGIN AUTHORED CONTENT --> |
2 | 2 |
3 <p>The Font Settings API allows you to manage Chrome's font settings.</p> | 3 <p>The Font Settings API allows you to manage Chrome's font settings.</p> |
4 | 4 |
5 <h2 id="manifest">Manifest</h2> | 5 <h2 id="manifest">Manifest</h2> |
6 <p>The Font Settings API is currently experimental, so you must declare the | 6 <p>The Font Settings API is currently experimental, so you must declare the |
7 "experimental" permission to use it. For example:</p> | 7 "experimental" permission to use it. For example:</p> |
8 <pre>{ | 8 <pre>{ |
9 "name": "My Font Settings Extension", | 9 "name": "My Font Settings Extension", |
10 "description": "Customize your fonts", | 10 "description": "Customize your fonts", |
(...skipping 22 matching lines...) Expand all Loading... |
33 per-script but also depend on language. For example, Chrome chooses the font for | 33 per-script but also depend on language. For example, Chrome chooses the font for |
34 Cyrillic (ISO 15924 script code "Cyrl") when a webpage specifies the Russian | 34 Cyrillic (ISO 15924 script code "Cyrl") when a webpage specifies the Russian |
35 language, and uses this font not just for Cyrillic script but for everything the | 35 language, and uses this font not just for Cyrillic script but for everything the |
36 font covers, such as Latin.</p> | 36 font covers, such as Latin.</p> |
37 | 37 |
38 <h2 id="examples">Examples</h2> | 38 <h2 id="examples">Examples</h2> |
39 <p>The following code gets the standard font for Arabic.</p> | 39 <p>The following code gets the standard font for Arabic.</p> |
40 <pre> | 40 <pre> |
41 chrome.experimental.fontSettings.getFont( | 41 chrome.experimental.fontSettings.getFont( |
42 { genericFamily: 'standard', script: 'Arab' }, | 42 { genericFamily: 'standard', script: 'Arab' }, |
43 function(details) { console.log(details.fontName); } | 43 function(details) { console.log(details.fontId); } |
44 ); | 44 ); |
45 </pre> | 45 </pre> |
46 | 46 |
47 <p>The next snippet sets the sans-serif font for Japanese.</p> | 47 <p>The next snippet sets the sans-serif font for Japanese.</p> |
48 <pre> | 48 <pre> |
49 chrome.experimental.fontSettings.setFont( | 49 chrome.experimental.fontSettings.setFont( |
50 { genericFamily: 'sansserif', script: 'Jpan', fontName: 'MS PGothic' } | 50 { genericFamily: 'sansserif', script: 'Jpan', fontId: 'MS PGothic' } |
51 ); | 51 ); |
52 </pre> | 52 </pre> |
53 | 53 |
54 <p>You can find a sample extension using the Font Settings API in the | 54 <p>You can find a sample extension using the Font Settings API in the |
55 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/fontSettings/">examples/api/fontSettings</a> | 55 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/fontSettings/">examples/api/fontSettings</a> |
56 directory. For other examples and for help in viewing the source code, see | 56 directory. For other examples and for help in viewing the source code, see |
57 <a href="samples.html">Samples</a>.</p> | 57 <a href="samples.html">Samples</a>.</p> |
58 | 58 |
59 <!-- END AUTHORED CONTENT --> | 59 <!-- END AUTHORED CONTENT --> |
OLD | NEW |