diff options
author | falken@chromium.org <falken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-29 08:45:02 +0000 |
---|---|---|
committer | falken@chromium.org <falken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-29 08:45:02 +0000 |
commit | dc7ca6101067c8172a66826655e297462432fed3 (patch) | |
tree | f24050460c6d4ddb13cebb504c601d64ee824b13 /chrome/common/extensions/docs/static | |
parent | 96463604db09ab5ebc843bdfb41c38e26990b755 (diff) | |
download | chromium_src-dc7ca6101067c8172a66826655e297462432fed3.zip chromium_src-dc7ca6101067c8172a66826655e297462432fed3.tar.gz chromium_src-dc7ca6101067c8172a66826655e297462432fed3.tar.bz2 |
Static documentation for Font Settings Extension API.
BUG=114148
TEST=none
Review URL: http://codereview.chromium.org/9784014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129594 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/static')
-rw-r--r-- | chrome/common/extensions/docs/static/experimental.fontSettings.html | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/chrome/common/extensions/docs/static/experimental.fontSettings.html b/chrome/common/extensions/docs/static/experimental.fontSettings.html new file mode 100644 index 0000000..b08d603 --- /dev/null +++ b/chrome/common/extensions/docs/static/experimental.fontSettings.html @@ -0,0 +1,63 @@ +<!-- BEGIN AUTHORED CONTENT --> + +<p>The Font Settings API allows you to manage Chrome's font settings.</p> + +<h2 id="manifest">Manifest</h2> +<p>The Font Settings API is currently experimental, so you must declare the +"experimental" permission to use it. For example:</p> +<pre>{ + "name": "My Font Settings Extension", + "description": "Customize your fonts", + "version": "0.2", + "permissions": ["experimental"] +}</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 based on ISO 15924 script codes 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 +Hangul (ISO 15924 script code "Hang") when a webpage specifies Korean language, +and uses this font not just for Hangul script but for everything the font +covers, such as Hanja.</p> + +<p>Although ISO 15924 provides script codes like "Japn" for Japanese and "Kore" +for Korean, these codes are newer than "Hrkt" and "Hang" which Chrome continues +to use for compatibility purposes.</p> + +<h2 id="examples">Examples</h2> +<p>The following code gets the standard font for Arabic.</p> +<pre> +chrome.experimental.fontSettings.getFontName( + { genericFamily: 'standard', script: 'Arab' }, + function(details) { console.log(details.fontName); } +); +</pre> + +<p>The next snippet sets the sans-serif font for Japanese.</p> +<pre> +chrome.experimental.fontSettings.setFontName( + { genericFamily: 'sansserif', script: 'Hrkt', fontName: 'IPAPGothic' } +); +</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 --> |