| OLD | NEW |
| 1 <h2 id="manifest">Manifest</h2> | 1 <h2 id="manifest">Manifest</h2> |
| 2 <p>To use the Font Settings API, you must declare the "fontSettings" permission | 2 <p>To use the Font Settings API, you must declare the "fontSettings" permission |
| 3 in the <a href="manifest.html">extension manifest</a>. | 3 in the <a href="manifest">extension manifest</a>. |
| 4 For example:</p> | 4 For example:</p> |
| 5 <pre data-filename="manifest.json"> | 5 <pre data-filename="manifest.json"> |
| 6 { | 6 { |
| 7 "name": "My Font Settings Extension", | 7 "name": "My Font Settings Extension", |
| 8 "description": "Customize your fonts", | 8 "description": "Customize your fonts", |
| 9 "version": "0.2", | 9 "version": "0.2", |
| 10 <b>"permissions": [ | 10 <b>"permissions": [ |
| 11 "fontSettings" | 11 "fontSettings" |
| 12 ]</b>, | 12 ]</b>, |
| 13 ... | 13 ... |
| 14 } | 14 } |
| 15 </pre> | 15 </pre> |
| 16 | 16 |
| 17 <h2 id="scripts">Generic Font Families and Scripts</h2> | 17 <h2 id="scripts">Generic Font Families and Scripts</h2> |
| 18 <p>Chrome allows for some font settings to depend on certain generic font | 18 <p>Chrome allows for some font settings to depend on certain generic font |
| 19 families and language scripts. For example, the font used for sans-serif | 19 families and language scripts. For example, the font used for sans-serif |
| 20 Simplified Chinese may be different than the font used for serif Japanese.</p> | 20 Simplified Chinese may be different than the font used for serif Japanese.</p> |
| 21 | 21 |
| 22 <p>The generic font families supported by Chrome are based on | 22 <p>The generic font families supported by Chrome are based on |
| 23 <a href="http://www.w3.org/TR/CSS21/fonts.html#generic-font-families">CSS generi
c font families</a> | 23 <a href="http://www.w3.org/TR/CSS21/fonts#generic-font-families">CSS generic fon
t families</a> |
| 24 and are listed in the API reference below. When a webpage specifies a generic | 24 and are listed in the API reference below. When a webpage specifies a generic |
| 25 font family, Chrome selects the font based on the corresponding setting. If no | 25 font family, Chrome selects the font based on the corresponding setting. If no |
| 26 generic font family is specified, Chrome uses the setting for the "standard" | 26 generic font family is specified, Chrome uses the setting for the "standard" |
| 27 generic font family.</p> | 27 generic font family.</p> |
| 28 | 28 |
| 29 <p>When a webpage specifies a language, Chrome selects the font based on the | 29 <p>When a webpage specifies a language, Chrome selects the font based on the |
| 30 setting for the corresponding language script. If no language is specified, | 30 setting for the corresponding language script. If no language is specified, |
| 31 Chrome uses the setting for the default, or global, script.</p> | 31 Chrome uses the setting for the default, or global, script.</p> |
| 32 | 32 |
| 33 <p>The supported language scripts are specified by ISO 15924 script code and | 33 <p>The supported language scripts are specified by ISO 15924 script code and |
| (...skipping 15 matching lines...) Expand all Loading... |
| 49 <p>The next snippet sets the sans-serif font for Japanese.</p> | 49 <p>The next snippet sets the sans-serif font for Japanese.</p> |
| 50 <pre> | 50 <pre> |
| 51 chrome.fontSettings.setFont( | 51 chrome.fontSettings.setFont( |
| 52 { genericFamily: 'sansserif', script: 'Jpan', fontId: 'MS PGothic' } | 52 { genericFamily: 'sansserif', script: 'Jpan', fontId: 'MS PGothic' } |
| 53 ); | 53 ); |
| 54 </pre> | 54 </pre> |
| 55 | 55 |
| 56 <p>You can find a sample extension using the Font Settings API in the | 56 <p>You can find a sample extension using the Font Settings API in the |
| 57 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/fontSettings/">examples/api/fontSettings</a> | 57 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/fontSettings/">examples/api/fontSettings</a> |
| 58 directory. For other examples and for help in viewing the source code, see | 58 directory. For other examples and for help in viewing the source code, see |
| 59 <a href="samples.html">Samples</a>.</p> | 59 <a href="samples">Samples</a>.</p> |
| OLD | NEW |