Index: chrome/common/extensions/docs/server2/templates/intros/fontSettings.html |
diff --git a/chrome/common/extensions/docs/server2/templates/intros/fontSettings.html b/chrome/common/extensions/docs/server2/templates/intros/fontSettings.html |
index d22db27d0f83b651faea907daf4ae52a79428dbc..1b16e63a22e8b69566baae9e59f75e7ccef269be 100644 |
--- a/chrome/common/extensions/docs/server2/templates/intros/fontSettings.html |
+++ b/chrome/common/extensions/docs/server2/templates/intros/fontSettings.html |
@@ -1,5 +1,5 @@ |
-<!-- BEGIN AUTHORED CONTENT --> |
<p>The Font Settings API allows you to manage Chrome's font settings.</p> |
+ |
<h2 id="manifest">Manifest</h2> |
<p>To use the Font Settings API, you must declare the "fontSettings" permission |
in the <a href="manifest.html">extension manifest</a>. |
@@ -10,41 +10,47 @@ For example:</p> |
"version": "0.2", |
"permissions": ["fontSettings"] |
}</pre> |
+ |
<h2 id="scripts">Generic Font Families and Scripts</h2> |
<p>Chrome allows for some font settings to depend on certain generic font |
families and language scripts. For example, the font used for sans-serif |
Simplified Chinese may be different than the font used for serif Japanese.</p> |
+ |
<p>The generic font families supported by Chrome are based on |
<a href="http://www.w3.org/TR/CSS21/fonts.html#generic-font-families">CSS generic font families</a> |
and are listed in the API reference below. When a webpage specifies a generic |
font family, Chrome selects the font based on the corresponding setting. If no |
generic font family is specified, Chrome uses the setting for the "standard" |
generic font family.</p> |
+ |
<p>When a webpage specifies a language, Chrome selects the font based on the |
setting for the corresponding language script. If no language is specified, |
Chrome uses the setting for the default, or global, script.</p> |
+ |
<p>The supported language scripts are specified by ISO 15924 script code and |
listed in the API reference below. Technically, Chrome settings are not strictly |
per-script but also depend on language. For example, Chrome chooses the font for |
Cyrillic (ISO 15924 script code "Cyrl") when a webpage specifies the Russian |
language, and uses this font not just for Cyrillic script but for everything the |
font covers, such as Latin.</p> |
+ |
<h2 id="examples">Examples</h2> |
<p>The following code gets the standard font for Arabic.</p> |
<pre> |
chrome.fontSettings.getFont( |
{ genericFamily: 'standard', script: 'Arab' }, |
- function(details) { console.log(details.fontName); } |
+ function(details) { console.log(details.fontId); } |
); |
</pre> |
+ |
<p>The next snippet sets the sans-serif font for Japanese.</p> |
<pre> |
chrome.fontSettings.setFont( |
- { genericFamily: 'sansserif', script: 'Jpan', fontName: 'MS PGothic' } |
+ { genericFamily: 'sansserif', script: 'Jpan', fontId: 'MS PGothic' } |
); |
</pre> |
+ |
<p>You can find a sample extension using the Font Settings API in the |
<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/fontSettings/">examples/api/fontSettings</a> |
directory. For other examples and for help in viewing the source code, see |
-<a href="samples.html">Samples</a>.</p> |
-<!-- END AUTHORED CONTENT --> |
+<a href="samples.html">Samples</a>.</p> |